8

In other words, I want something like npm install --save foo

...but I only want it to update my package.json (adding the name and latest version number to my dependencies), and I want it to skip the actual installation into node_modules. Is this possible?

I tried --dry-run and this does skip the installation but it also skips updating package.json :/


(Yes, I could just edit the package.json manually, but I want to do this for about 30 dependencies at once, so I want to make use of npm's ability to automatically look up the latest version number for each one.)

callum
  • 34,206
  • 35
  • 106
  • 163
  • i am looking for a similar solution since i am using docker to install the deps. did you figure this out? – Bamieh Jun 11 '17 at 11:29

1 Answers1

0

You could use npm-check-updates plugin https://www.npmjs.com/package/npm-check-updates

npm-check-updates will check for latest version updates and update your package.json

To install npm-check-updates run npm install -g npm-check-updates

To check for updates run npm-check-updates

To update your package.json with latest version without installing run npm-check-updates -u

To install the updated versions run npm install

  • That is similar to what I want, but I want to be able to add new deps, not just update the version tag on pre-existing deps – callum Mar 06 '16 at 00:07