doc: document the error when cwd not exists in child_process.spawn

If the option cwd does not exist, the error ENOENT is the same as
the error emitted when the command does not exist, it's confusing.

PR-URL: https://github.com/nodejs/node/pull/34505
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
FeelyChau authored and Shelley Vohr committed 2020-11-22 12:42:40 -08:00
1 parent 6349b1d673
commit eefc6aa6c9
1 file changed
+4 -1
+4 -1
View File
@@ -469,7 +469,10 @@ const defaults = {
```
Use `cwd` to specify the working directory from which the process is spawned.
If not given, the default is to inherit the current working directory.
If not given, the default is to inherit the current working directory. If given,
but the path does not exist, the child process emits an `ENOENT` error
and exits immediately. `ENOENT` is also emitted when the command
does not exist.
Use `env` to specify environment variables that will be visible to the new
process, the default is [`process.env`][].