I'm using NPM and shrinkwrap (latest up to date version) to maintain my packages.
At the moment, one of my package current version is 1.1.0. The latest version of this package is 2.2.0.
I want to update/upgrade this specific package to version 2.0.0 (and not the latest 2.2.0).
I thought that the procedure would be:
npm install
in order to make sure that I'm synchronized with the npm-shrinkwrapnpm update [email protected]
npm shrinkwrap
git add . && git commit -m "Updating package myPackage to version 2.0.0"
This doesn't seem to be the right road to go. It doesn't update the package.json
and it always jump to the latest version. I have no control over this command to select the specific version I want.
I read the documentation about npm update
and couldn't find the proper way to update the package to a specific version.
How to do this ? Would npm install --save [email protected]
would be the correct procedure ? Then what will be the purpose of having npm update
command ?
Solution: npm install [email protected] --save
npm update
doesn't seem to interact with the shrinkwrap file as far as I can tell. But you can use npm install
to set the version of a package.
This will update both package.json and npm-shrinkwrap.json:
npm install [email protected] --save
You can enter to package.json
and write the version yourself on the dependencies. After that do npm install
and it will install the correct version.
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