child_process: document the error when cwd does not exist#34505
child_process: document the error when cwd does not exist#34505FeelyChau wants to merge 2 commits intonodejs:masterfrom FeelyChau:child-process-spawn-doc
Conversation
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.
|
Welcome @FeelyChau and thanks for the pull request. |
|
@Trott Thanks for review. const ChildProcess = require('child_process');
const cp = ChildProcess.spawn('/usr/local/bin/node', [], { cwd: 'path_not_exists' });
cp.on('error', (err) => {
console.log(err);
})the output: Error: spawn /usr/local/bin/node ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn /usr/local/bin/node',
path: '/usr/local/bin/node',
spawnargs: []
}The error is not specific. node/deps/uv/src/unix/process.c Line 342 in 3751662 |
|
I did address a bug related in mine until I found the call to |
aduh95
left a comment
There was a problem hiding this comment.
I'm good with this personally.
|
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
|
Landed in bea9857 |
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 <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
If the option cwd does not exist, the error
ENOENTis the same as the error emitted when the command does not exist, it's confusing.Checklist