-
-
Notifications
You must be signed in to change notification settings - Fork 37.3k
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 requesting new Node.js features.Issues requesting new Node.js features.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
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 requesting new Node.js features.Issues requesting new Node.js features.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
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?