-
Notifications
You must be signed in to change notification settings - Fork 285
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
npm outdated unable to be run programmatically from child_process.execSync #4188
Comments
cc @nodejs/npm I believe this is working as designed. Looks like there's some discussion about the npm behaviour in npm/rfcs#473. |
@richardlau Thank you for the response. At least now I understand how I can work around this. I didn't even consider that a non-zero exit code was expected when outdated packages are found because the command succeeds in retrieving information about them. |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Version
16.20.0, 18.6.0, 20.3.0
Platform
Linux --- 5.15.90.1-microsoft-standard-WSL2 nodejs/node#1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
child_process
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always. This also occurs with a request of
execSync('npm outdated')
(without flags).What is the expected behavior? Why is that the expected behavior?
A
Buffer
including the results ofnpm outdated
.The example I'm using should have this output:
What do you see instead?
Additional information
stdout
buffer from hex to ascii, it does have the correct data, but the call fails for some reason.execSync('npm i')
,execSync('npm audit')
,execSync('npm config list --json')
, etc. will succeed.The text was updated successfully, but these errors were encountered: