Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
A call to npm outdated, if there are outdated packages, throws an exit code status of 1
C:\temp>node
Welcome to Node.js v16.11.0.
Type ".help" for more information.
> require('child_process').execSync('npm outdated -g --depth=0')
Uncaught Error: Command failed: npm outdated -g --depth=0
at checkExecSyncError (node:child_process:826:11)
at Object.execSync (node:child_process:900:15) {
status: 1,
signal: null,
output: [
null,
<Buffer 50 61 63 6b 61 67 65 20 20 20 20 20 20 20 20 20 20 20 20 20 43 75 72 72 65 6e 74 20 20 20 57 61 6e 74 65 64 20 20 20 4c 61 74 65 73 74 20 20 4c 6f 63 ... 216 more bytes>,
<Buffer >
],
pid: 14996,
stdout: <Buffer 50 61 63 6b 61 67 65 20 20 20 20 20 20 20 20 20 20 20 20 20 43 75 72 72 65 6e 74 20 20 20 57 61 6e 74 65 64 20 20 20 4c 61 74 65 73 74 20 20 4c 6f 63 ... 216 more bytes>,
stderr: <Buffer >
}
C:\temp>npm -v
8.0.0
Expected Behavior
It was working like this in the the node.js 16.x branch until 16.11.
C:\temp>node
Welcome to Node.js v16.10.0.
Type ".help" for more information.
> require('child_process').execSync('npm outdated -g --depth=0')
<Buffer 50 61 63 6b 61 67 65 20 20 20 20 20 20 20 20 20 20 20 20 20 43 75 72 72 65 6e 74 20 20 20 57 61 6e 74 65 64 20 20 20 4c 61 74 65 73 74 20 20 4c 6f 63 ... 216 more bytes>
C:\temp>npm -v
7.24.0
Steps To Reproduce
-
In this environment...
Windows 10 pro x64. Node.js v16.11.0 (with included npm v8.0.0) -
With this config...
A system with global outdated packages. -
Run '...'
require('child_process').execSync('npm outdated -g --depth=0') -
See error...
Throws a exit status code of 1
Environment
- OS: Windows 10 Pro x64
- Node: 16.11.0
- npm: 8.0.0