Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96dc591

Browse filesBrowse files
zobobengl
authored andcommitted
doc: clarify path search in child_process.spawn
The documentation about command lookup could be more clear and note differences between Windows and Linux/OSX. Current text gives the impression that if one passes `options.env` without `PATH`, the path search will fall back on `process.env.PATH`. In reality, passing environment without `PATH` to `execvp` causes it to look for the binary only in `/usr/bin:/bin`. Also Windows behaves different and more in line with the current documentation text. PR-URL: #41418 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent dfdce7c commit 96dc591
Copy full SHA for 96dc591

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/child_process.md‎

Copy file name to clipboardExpand all lines: doc/api/child_process.md
+5-2Lines changed: 5 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
3636
option if the output will not be consumed.
3737

3838
The command lookup is performed using the `options.env.PATH` environment
39-
variable if it is in the `options` object. Otherwise, `process.env.PATH` is
40-
used.
39+
variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
40+
used. If `options.env` is set without `PATH`, lookup on Unix is performed
41+
on a default search path search of `/usr/bin:/bin` (see your operating system's
42+
manual for execvpe/execvp), on Windows the current processes environment
43+
variable `PATH` is used.
4144

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.