Skip to content

Commit

Permalink
doc: fix copy node executable in Windows
Browse files Browse the repository at this point in the history
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: nodejs#48624
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
yoavain authored Jul 6, 2023
1 parent a1fe0d7 commit d9438cc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions doc/api/single-executable-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d9438cc

Please sign in to comment.