Skip to content

Commit 11899f6

Browse files
lundibunditargos
authored andcommitted
doc: clear up child_process command resolution
Fixes: #20605 Refs: libuv/libuv#1837 PR-URL: #32091 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent e33e989 commit 11899f6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/api/child_process.md

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ process will block waiting for the pipe buffer to accept more data. This is
3333
identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`
3434
option if the output will not be consumed.
3535

36+
The command lookup will be performed using `options.env.PATH` environment
37+
variable if passed in `options` object, otherwise `process.env.PATH` will be
38+
used. To account for the fact that Windows environment variables are
39+
case-insensitive Node.js will lexicographically sort all `env` keys and choose
40+
the first one case-insensitively matching `PATH` to perform command lookup.
41+
This may lead to issues on Windows when passing objects to `env` option that
42+
have multiple variants of `PATH` variable.
43+
3644
The [`child_process.spawn()`][] method spawns the child process asynchronously,
3745
without blocking the Node.js event loop. The [`child_process.spawnSync()`][]
3846
function provides equivalent functionality in a synchronous manner that blocks

0 commit comments

Comments
 (0)