Skip to content

Commit 999ae0c

Browse files
yoavainjuanarbol
authored andcommitted
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: #48624 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7daefae commit 999ae0c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

doc/api/single-executable-applications.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,8 @@ tool, [postject][]:
5858

5959
* On Windows:
6060

61-
Using PowerShell:
62-
63-
```powershell
64-
cp (Get-Command node).Source hello.exe
65-
```
66-
67-
Using Command Prompt:
68-
6961
```text
70-
for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe)
62+
node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')"
7163
```
7264

7365
The `.exe` extension is necessary.

0 commit comments

Comments
 (0)