NPM 3.8.6 broken?

What I Wanted to Do

npm install

What Happened Instead

This error:
npm ERR! Linux 3.13.0-139-generic
npm ERR! argv “/home/ubuntu/nvm/versions/node/v6.1.0/bin/node” “/home/ubuntu/nvm/versions/node/v6.1.0/bin/npm” “i”
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/install/deps.js:455:12)
npm ERR! typeerror at /home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/install/deps.js:456:7
npm ERR! typeerror at /home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /home/ubuntu/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues;

Reproduction Steps

Sorry, will add tomorrow if time allows. I believe it’s a pretty core issue so any package.json should fail, as npm 3.8.6 is also unable to self-update… well it does, but it ends up in a broken state:

457 verbose stack ZlibError: zlib: zlib binding closed
457 verbose stack at ZlibError (/usr/local/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/minizlib/index.js:14:5)
457 verbose stack at Unzip.Zlib.(anonymous function) (/usr/local/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/minizlib/index.js:126:21)
457 verbose stack at Unzip.write (/usr/local/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/minizlib/index.js:247:21)
457 verbose stack at Unpack.write (/usr/local/nvm/versions/node/v6.1.0/lib/node_modules/npm/node_modules/tar/lib/parse.js:308:19)
457 verbose stack at PassThrough.ondata (_stream_readable.js:555:20)
457 verbose stack at emitOne (events.js:96:13)
457 verbose stack at PassThrough.emit (events.js:188:7)
457 verbose stack at readableAddChunk (_stream_readable.js:172:18)
457 verbose stack at PassThrough.Readable.push (_stream_readable.js:130:10)
457 verbose stack at PassThrough.Transform.push (_stream_transform.js:128:32)
457 verbose stack at afterTransform (_stream_transform.js:77:12)
457 verbose stack at TransformState.afterTransform (_stream_transform.js:54:12)
457 verbose stack at PassThrough._transform (_stream_passthrough.js:21:3)
457 verbose stack at PassThrough.Transform._read (_stream_transform.js:167:10)
457 verbose stack at PassThrough.Transform._write (_stream_transform.js:155:12)
457 verbose stack at doWrite (_stream_writable.js:307:12)

Platform Info

Tested on:

fails:
linux, ubuntu 12.04, node 6.1.0, npm 3.8.6
darwin, macOS 10.14.5, node 6.1.0, npm 3.8.6

works:
linux, ubuntu 12.04, node 6.1.0, npm 6.10.0
darwin, macOS 10.14.5, node 6.1.0, npm 6.10.0

I am guessing this is probably https://github.com/lodash/lodash/issues/4358.

1 Like