Skip to content

Instantly share code, notes, and snippets.

@rochoa
Last active November 6, 2015 12:37
Show Gist options
  • Save rochoa/3e8f4d4c374cba7f1e99 to your computer and use it in GitHub Desktop.
Save rochoa/3e8f4d4c374cba7f1e99 to your computer and use it in GitHub Desktop.
npm shrinkwrap regression

There is a regression between versions 1.2.0 and 1.2.1 of npm when generating npm-shrinkwrap.json from >=1.2.1 and using it with <1.2.1

Steps to reproduce

nvm use 0.8.18 # this uses npm@1.2.2 but regression was introduced in npm@1.2.1
npm install
npm shrinkwrap

rm -rf node_modules/

nvm use 0.8.17 # this uses npm@1.2.0
npm install

Result

npm ERR! Error: No compatible version found: underscore@'underscore@1.6.0'
npm ERR! Valid install targets:
npm ERR! ["1.0.3","1.0.4","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.1.7","1.2.0","1.2.1","1.2.2","1.2.3","1.2.4","1.3.0","1.3.1","1.3.2","1.3.3","1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.5.0","1.5.1","1.5.2","1.6.0","1.7.0"]
{
"private": true,
"name": "npm-shrinkwrap-regression",
"version": "0.1.0",
"description": "Example with regression between npm 1.2.0 and 1.2.1",
"main": "source.js",
"repository": "",
"keywords": [
"npm",
"shrinkwrap",
"regression",
"backwards",
"compatible"
],
"dependencies": {
"underscore" : "1.6.0"
},
"author": "Raul Ochoa",
"license": "BSD"
}
process.exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment