JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

npm install fails after clone with some dependencies #78

Closed aramonc closed 8 years ago

aramonc commented 8 years ago

We have a bootstrap repo that we use to create new projects. It contains a package.json, npm-shrinkwrap.json and ./node_shrinkwrap directory with the basic dependencies we use on ever project. However, after a fresh clone, running npm install results in error like:

npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/topo/node_shrinkwrap/hoek-4.1.0.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/pump/node_shrinkwrap/end-of-stream-1.1.0.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/oppsy/node_shrinkwrap/hoek-4.1.0.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/accept-2.1.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/ammo-2.0.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/boom-4.0.0.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/call-3.0.3.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/catbox-7.1.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/catbox-memory-2.0.3.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/cryptiles-3.0.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/heavy-4.0.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/hoek-4.0.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/iron-4.0.3.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/items-2.1.1.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/joi-9.0.4.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/mimos-3.0.3.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/podium-1.2.3.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/shot-3.3.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/statehood-5.0.0.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/subtext-4.2.2.tar
npm ERR! addLocal Could not install /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/hapi/node_shrinkwrap/topo-2.0.2.tar
npm ERR! Linux 4.4.0-38-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3
npm ERR! path /media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/topo/node_shrinkwrap/hoek-4.1.0.tar
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/topo/node_shrinkwrap/hoek-4.1.0.tar'
npm ERR! enoent ENOENT: no such file or directory, open '/media/aramonc/Extra/Projects/Cuemby/error_demo/node_modules/topo/node_shrinkwrap/hoek-4.1.0.tar'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /media/aramonc/Extra/Projects/Cuemby/error_demo/npm-debug.log

We've narrowed it down to "it happens only with some dependencies, but not everything". So in the reproduction I used hapi & good which are a couple of the packages it happens with.

You can reproduce this by running the following

$ mkdir error_demo
$ cd error_demo
$ npm init
...
$ npm i --save hapi good
$ npm shrinkwrap
$ shrinkpack .
$ rm -rf node_modules
$ npm i

npm-debug.log npm-shrinkwrap.json package.json

markerikson commented 8 years ago

Supposedly this was fixed in NPM 3.10.4, but I'm still seeing it myself even with 3.10.8.

lime commented 8 years ago

This indeed appears to be the same error as #45. As the readme states, npm 3.8.8 to 3.10.3 are affected, but from 3.10.4 onward it should be fixed.

@markerikson, it sounds worrying that you're seeing the same with 3.10.8. 😕 Does it work differently with other patch versions >= 3.10.4?

aramonc commented 8 years ago

We'll try installing npm 3.10.4 & let you know.

aramonc commented 8 years ago

updated NPM to latest version 3.10.8 & it's working. Thank you. Didn't notice the latest NodeJS didn't include the latest NPM.