Repository navigation
process.argv[0] contains full node.exe path on Windows, docs say it must be just "node" #7434
Description
Activity
./node -p 'process.argv[0]' /Users/Jeremiah/Documents/node/out/Release/nodeThe docs are arguably not entirely correct. It will be the node binary, wherever that is. (Including the path.)
- addedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.and removedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Jun 27, 2016 More specifically, how you invoked the node binary.
node ...will havenodebut./will append the path to the local node.I started
cmd,cdd intoC:\Program Files (x86)\nodejs, so it's now the current path. I runnode fullPathToJsFile- addedprocessIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
on Jun 27, 2016 - addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Jun 27, 2016 There’s this line which will always set
process.argv[0]toprocess.execPath, so usually it won’t matter hownodewas invoked.I am up for taking this up.
What needs to done exactly modifying docs?The
process.argvdocs should be updated to say that the first element will beprocess.execPath. It would probably be good to link there too.@cjihrig Why did the behavior change since perhaps two years ago? I remember clearly that a while ago it was
node, not full path.#1194 was the PR that changed this for Windows.
I honestly don't recall.
9 remaining items
@addaleax I'm suprised to see so many contributors signing off a commit. It usually takes up to two contributors (elsewhere). I won't make any conclusions.
@Dmitry-Me I think it’s just that there is a tendency for small changes that are easy to review to gain more reviewers, that’s all. :)
Reacted by Tarun Garg- added a commit that references this issue
on Aug 8, 2016 - added a commit that references this issue
on Aug 10, 2016 - addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.and removeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Dec 1, 2016 - added a commit that references this issue
on Jul 27, 2026
Documentation https://nodejs.org/api/process.html#process_process_argv says
process.argv[0]must benodebut I run this code on Windowsand it outputs this
which kind of isn't the same as
node. It wasnodeon some earlier versions - perhaps a couple years ago.Here's how I run my code: I started
cmd.exe,cdd intoC:\Program Files (x86)\nodejs, so it's now the current path and I run