-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process: spawn incorrect error #45279
Comments
I want to know the full content of magicFunction. |
@zhmushan Hello, magic function - it can be anything, but if there is actually no path, then the error does not explicitly say so spawn ls ENOENT it can take a newbie hours to figure out what's going on, so it will be easier HandleError [ERR_INVALID_ARG_ENOENT]: The "options.cwd" property no such file or directory. for example, I specifically made a mistake in the code in another parameter: var cp = spawn('ls', [], { argv0: new Buffer([]) });
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "options.argv0" property must be of type string. Received an instance of Buffer by mistake everything is clear |
I can confirm the issue but unfortunately it isn't really fixable. The For Even if the child provided more details, libuv's As a libuv maintainer, I'm going to make the judgment call that this issue isn't pressing enough to introduce a new spawn API. Doubly so because the issue would still exist with |
Version
v18.5.0
Platform
5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
Error: spawn cwd ENOENT
What do you see instead?
Error: spawn ls ENOENT
Additional information
Hi, when calling system commands error is misleading, literally, spawn can't find ls,
actually the problem is in cwd.
It seemed that the problem is with the first argument
ls
-->/bin/bash
and two argument[]
-->['-c', 'ls']
or systems environment OS PATH but not cwdThe text was updated successfully, but these errors were encountered: