Skip to content

Instantly share code, notes, and snippets.

@aseemk
Last active December 26, 2015 10:59
Show Gist options
  • Select an option

  • Save aseemk/7140369 to your computer and use it in GitHub Desktop.

Select an option

Save aseemk/7140369 to your computer and use it in GitHub Desktop.
npm shrinkwrap issues w/ de-duped production + dev dependencies

Install a dev dependency, then install a production dependency that (internally) depends on that same dev dependency. (Should you have to know that? Is that not an implementation detail?)

Then shrinkwrap for production, and note the missing nested dependency.

npm init
npm install request@2.x --save-dev
npm install strong-agent --save
npm shrinkwrap
{
"name": "shrinkwrap-test-devdeps1",
"version": "0.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"strong-agent": "~0.2.15"
},
"devDependencies": {
"request": "~2.27.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause"
}
{
"name": "shrinkwrap-test-devdeps",
"version": "0.0.0",
"dependencies": {
"strong-agent": {
"version": "0.2.15",
"from": "strong-agent@~0.2.15",
"dependencies": {
"async": {
"version": "0.1.22",
"from": "async@~0.1.22"
},
"measured": {
"version": "0.1.3",
"from": "measured@~0.1"
},
"restler": {
"version": "2.0.1",
"from": "restler@2.x"
},
"zeparser": {
"version": "0.0.7",
"from": "zeparser@*"
},
"underscore": {
"version": "1.5.2",
"from": "underscore@1.x"
},
"uhura": {
"version": "0.0.10",
"from": "uhura@stable",
"dependencies": {
"JSONStream": {
"version": "0.6.4",
"from": "JSONStream@0.6.x",
"dependencies": {
"jsonparse": {
"version": "0.0.5",
"from": "jsonparse@0.0.5"
},
"through": {
"version": "2.2.7",
"from": "through@~2.2.7"
}
}
},
"connect": {
"version": "2.8.8",
"from": "connect@2.8.x",
"dependencies": {
"qs": {
"version": "0.6.5",
"from": "qs@0.6.5"
},
"formidable": {
"version": "1.0.14",
"from": "formidable@1.0.14"
},
"cookie-signature": {
"version": "1.0.1",
"from": "cookie-signature@1.0.1"
},
"buffer-crc32": {
"version": "0.2.1",
"from": "buffer-crc32@0.2.1"
},
"cookie": {
"version": "0.1.0",
"from": "cookie@0.1.0"
},
"send": {
"version": "0.1.4",
"from": "send@0.1.4",
"dependencies": {
"mime": {
"version": "1.2.11",
"from": "mime@~1.2.9"
},
"range-parser": {
"version": "0.0.4",
"from": "range-parser@0.0.4"
}
}
},
"bytes": {
"version": "0.2.0",
"from": "bytes@0.2.0"
},
"fresh": {
"version": "0.2.0",
"from": "fresh@0.2.0"
},
"pause": {
"version": "0.0.1",
"from": "pause@0.0.1"
},
"uid2": {
"version": "0.0.2",
"from": "uid2@0.0.2"
},
"debug": {
"version": "0.7.2",
"from": "debug@*"
},
"methods": {
"version": "0.0.1",
"from": "methods@0.0.1"
}
}
},
"uid2": {
"version": "0.0.3",
"from": "uid2@0.0.x"
}
}
},
"memwatch": {
"version": "0.2.2",
"from": "memwatch@~0.2"
},
"timekit": {
"version": "0.1.8",
"from": "timekit@0.1.8",
"dependencies": {
"bindings": {
"version": "1.1.1",
"from": "bindings@*"
}
}
},
"strong-cpu-profiler": {
"version": "0.1.0",
"from": "strong-cpu-profiler@stable"
},
"nodefly-gcinfo": {
"version": "0.0.15",
"from": "nodefly-gcinfo@latest"
},
"nodefly-uvmon": {
"version": "0.0.7",
"from": "nodefly-uvmon@stable"
}
}
}
}
}
@luk-

luk- commented Oct 24, 2013

Copy link
Copy Markdown

You can work around this by using npm shrinkwrap --dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment