-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Incorrect ENOENT error on Windows with shell=true when child exits with code 1 #446
Comments
Can you try the same with |
The error is indeed in |
The output from
|
@ehmicky @sindresorhus Yes, moxystudio/node-cross-spawn#104 definitely is describing the same issue within Honestly, I think the |
Yes, I agree with you about the If we do so, no changes will be required in |
I agree. |
@sindresorhus If you'd like, I'd be happy to submit a PR. Just let me know. |
I'm realizing we don't need to wait for |
No problem on creating a PR. So just to double-extra confirm: you just want the call to All that sound ok? |
This sounds good to me, thanks for clarifying the fact that is technically a breaking change (although this could also be considered a bug fix I believe, depending on the way you look at it). What do you think @sindresorhus? |
I'm just thinking that for any user of |
Yes, definitely. |
Summary
On Windows, when the execa child process exits with exit code 1 and the
shell
option is set totrue
, the error thrown is alwaysENOENT
even though the child process was found and executed correctly (albeit with a non-zero exit code).Using this code as an example:
Expected behavior
The output should be:
Actual behavior
The current output is:
Additional information
The issue appears to be related to
verifyENOENT
from thecross-spawn
library and its incorrect detection of whether a valid file was found to execute.The following code shows that the issue only occurs when the child's exit code is 1, but not for exit code 2:
As an additional test case, I'd recommend the following code because
exit
is a shell command, not an executable in the path. This code should not throw anENOENT
error.The text was updated successfully, but these errors were encountered: