- npm is crashing.
- npm is producing an incorrect install.
- npm is doing something I don't understand.
- Other (see below for feature requests):
When using NPM 5: if I run the npm view
command in a child process (either exec
or spawn
) the child process exits with code 0 right after the reception of the first chunk of data.
Considering this simple Node program:
const exec = require('child_process').exec;
const child = exec('npm view npm@latest');
child.stdout.on('data', data => {
console.log('DATA', data.length);
});
child.stderr.on('data', data => {
console.log('ERROR', data.length);
});
child.on('exit', code => {
console.log('EXIT', code);
});
Output when NPM 4.6.1 is installed:
$ node debug-exec.js
DATA 8192
DATA 8192
DATA 8189
DATA 8191
DATA 3817
EXIT 0
Output when NPM 5.0.0 is installed:
$ node debug-exec.js
DATA 8192
EXIT 0
There is no problem with these commands (the whole output is received whatever the NPM version):
ls -l node_modules
curl -s https://github.com/ncuillery
npm -v
prints: either4.6.1
or5.0.0
node -v
prints:v7.1.0
npm config get registry
prints:https://registry.npmjs.org/
- Windows, OS X/macOS, or Linux?: macOS Sierra 10.12.4
- Network issues:
- Geographic location where npm was run:
- I use a proxy to connect to the npm registry.
- I use a proxy to connect to the web.
- I use a proxy when downloading Git repos.
- I access the npm registry via a VPN
- I don't use a proxy, but have limited or unreliable internet access.
- Container:
- I develop using Vagrant on Windows.
- I develop using Vagrant on OS X or Linux.
- I develop / deploy using Docker.
- I deploy to a PaaS (Triton, Heroku).