Skip to content

Commit

Permalink
doc: document the error when cwd not exists in child_process.spawn
Browse files Browse the repository at this point in the history
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: #34505
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
FeelyChau authored and BethGriggs committed Dec 15, 2020
1 parent 8516c2e commit c088434
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`][].
Expand Down

0 comments on commit c088434

Please sign in to comment.