Created
December 13, 2016 05:01
-
-
Save DanielHeath/bb56e1cdd59d29eba6433b78d492c855 to your computer and use it in GitHub Desktop.
Revisions
-
DanielHeath created this gist
Dec 13, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # How does npm >4.0 work with shrinkwrapping? ## What happens when I run `npm i` without a shrinkwrap file For each dependency specified in package.json, npm attempts to find a compatible version, and installs it (and all dependencies, transitively) to node_modules ## What happens when I run `npm i` with a shrinkwrap file The exact versions of the libraries specified in the shrinkwrap file are installed, regardless of whether they match package.json or have their dependencies met. ## What happens when I run `npm shrinkwrap`? The exact versions of the currently installed libraries in `node_modules` are written to `npm-shrinkwrap.json`. The reason they are there (eg is this a devDependency) are also recorded, so you can later `npm i --production` to skip the devDependencies.