For each dependency specified in package.json, npm attempts to find a compatible version, and installs it (and all dependencies, transitively) to node_modules
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.
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.