Closed lime closed 8 years ago
Thanks Emil, sounds good. Agree it would make sense in the case of from-Git repos that the commit SHA is incorporated somehow.
This seems to be a relevant upstream issue: https://github.com/npm/npm/issues/4042
If I'm reading it correctly, it sounds like trying to work around it on the shrinkpack side might be an uphill battle...
thanks @lime, I will close this and mark as upstream. If anyone has any other ideas please feel free to comment.
I believe this is working fine with npm 3.x
We had a couple of occurrences of strange behaviour after starting to use a git fork of a library. The fix (applied once per machine, then forgotten again) was to
rm -rf node_modules/library-name
and runnpm install
again. It let us get on with work, but I started to wonder whether it was a consistent issue that could be reproduced and fixed.Consider the following scenario:
potatoes
library, version3.5.0
"./node_shrinkwrap/potatoes-3.5.0.tgz"
master
, so itspackage.json
hasversion
set to3.5.0
.git://
and run shrinkwrap & shrinkpackpotatoes-3.5.0.tgz
still has the same name, but different contentnpm install
potatoes
installed at3.5.0
, npm does nothingIt seems like npm doesn't get any indication that a new install would be needed. Without shrinkpack, I guess
from
/resolved
would change to point to the git commit andversion
would stay the same. With shrinkpack, none of them change.One solution could be to include the commit hash in the tarball name, e.g.
node_shrinkwrap/potatoes-3.5.0-ab01cd2.tgz
.I hope to create reproducible step-by-step commands to verify that what I described above actually is what happens (I'm much less than 100% sure). I should also check whether a non-shrinkpacked project behaves differently. Still, I thought it could be useful to raise the issue. If nothing else, it should push me to get the debugging done. :)
I had the feeling that I had seen this discussed somewhere before, but didn't find it. If this is already known / fixed, sorry for the noise.
I'm on shrinkpack 0.12.2, npm 2.15.4 and node 4.4.0.