Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


WARN if npm-shrinkwrap.json is present #2660

wants to merge 2 commits into from

2 participants


This small patch outputs a warning if npm-shrinkwrap.json is present. This is generally useful for informing the user that the shrinkwrap file has been picked up. In particular it is useful for cloud providers which dump the console output and where the user may not know if shrinkwrap is supported.


Making this a warning seems a bit excessive. Is enough? Typically you'd be running npm install in your own project or something, where you created the npm-shrinkwrap.json file yourself, right?


Right, but what i'm saying is:

I've put a shrinkwrap.json in my git repo, then push it to you, then you warn me about it? That sounds weird to me.

Typically, we warn about unexpected behavior, not things working exactly as designed because the user explicitly asked for it.

@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/install.js
5 lib/install.js
@@ -85,6 +85,11 @@ function install (args, cb_) {
// the /path/to/node_modules/..
var where = path.resolve(npm.dir, "..")
+ // output a message if shrinkwrap is present
+ if(path.resolve(where, "npm-shrinkwrap.json")) {
+ log.warn("install", "using npm-shrinkwrap.json");
+ }
// internal api: install(where, what, cb)
if (arguments.length === 3) {
where = args
Something went wrong with that request. Please try again.