Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
Check cwd before spawning child process #11520
Copy link
Copy link
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.stale
Description
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.stale
When a cwd is passed to
child_process.spawn()that does not exist, node just reportsENOENT:This error message is very confusing because it reads like
/usr/local/bin/nodedoes not exist. It took me several hours to debug this issue, including serious doubts in my sanity 😁.Do you think it is feasible to check the cwd before spawning the process, or is there a use-case/is it possible to spawn a process with a non-existent cwd? If it's not feasible, would it be an option to include the cwd in the error message to give a slight hint in the right direction?