Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Clarify path search in child_process spawn #41418

Merged
merged 4 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
option if the output will not be consumed.

The command lookup is performed using the `options.env.PATH` environment
variable if it is in the `options` object. Otherwise, `process.env.PATH` is
used.
variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
used. If `options.env` is set, but without `PATH`, lookup on UNIX is performed
zobo marked this conversation as resolved.
Show resolved Hide resolved
on a default search path search of `/usr/bin:/bin` (see execvpe/execvp), on Windows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(see execvpe/execvp)

is there a link you can include here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of "mirrors" on the net, but I'm not sure what the official would be (and maybe not contain ads):

Maybe it could just say to consult your operating system manual?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated proposed docs with comment about execvp

the current processes environment variable `PATH` is used.

On Windows, environment variables are case-insensitive. Node.js
lexicographically sorts the `env` keys and uses the first one that
Expand Down