From 999ae0c8c3d404d69bf83c697ebd8736c0910b98 Mon Sep 17 00:00:00 2001 From: Yoav Vainrich Date: Thu, 6 Jul 2023 22:28:59 +0300 Subject: [PATCH] doc: fix copy node executable in Windows Windows where command lists all places it finds a pattern in Path. The first one is the one that executes when called. So the old code was overriding the first executable by any other match. PR-URL: https://github.com/nodejs/node/pull/48624 Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca --- doc/api/single-executable-applications.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 2dedd17527ba87..2db06fdd7239e1 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -58,16 +58,8 @@ tool, [postject][]: * On Windows: - Using PowerShell: - - ```powershell - cp (Get-Command node).Source hello.exe - ``` - - Using Command Prompt: - ```text - for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe) + node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')" ``` The `.exe` extension is necessary.