What does running:
npm update
do if a npm-shrinkwrap.json file exists? Does it
Thanks in advance
When you run
npm update
It will update the dependencies to obey package.json and will not care what is stored in npm-shrinkwrap.json
even when node_modules
folder is empty which means update command will install using package.json
while install command will use npm-shrinkwrap.json
.
It does not make any sense to obey the shrinkwrap file[ in most cases.]
Reason
It is supposed to be a snapshot of package at some stable point and this thing makes it perfect for production code.
There are no ^
,~
,latest
etc. in shrinkwrap file.
However when you run
npm install
It follows shrinkwrap file.
But when you run
npm install newPkg --save
It will change both package.json
and npm-shrinkwrap.json
file as well
But when you run
npm update pkg --save
It will change only npm-shrinkwrap.json
file and as I wrote before it will use package.json
file to update according to semver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With