Skip to content

process.argv[0] contains full node.exe path on Windows, docs say it must be just "node" #7434

Closed
@Dmitry-Me

Description

@Dmitry-Me
  • Version: 4.4.6.0
  • Platform: Windows 7 Enterprise SP1
  • Subsystem: no idea

Documentation https://nodejs.org/api/process.html#process_process_argv says process.argv[0] must be node but I run this code on Windows

console.log('argv[0]: ' + process.argv[0]);

and it outputs this

argv[0]: C:\Program Files (x86)\nodejs\node.exe

which kind of isn't the same as node. It was node on some earlier versions - perhaps a couple years ago.

Here's how I run my code: I started cmd.exe, cdd into C:\Program Files (x86)\nodejs, so it's now the current path and I run

node fullPathToJsFile

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions