6

I have a project like this
enter image description here

I want to update all private_mod version (root and nested levels) to 1.3.2. Is there a npm way to do so?

Note: Each dependecy (dep-1, dep-2, dep-3) have their own package.json

One way that I can think of doing is:
- generate shrinkwrap file npm shrinkwrap
- Manually edit npm-sharinkwrap.json file for newer version of private_mod for all dependencies
- Do npm install again to install new packages off the shrinkwrap file

rohit12sh
  • 827
  • 2
  • 11
  • 24
  • What is your motivation for this? Messing with dependencies' dependencies is almost always a bad idea. There's probably a good reason "dep-3" specifies the version of lodash that it does (this is actually a good example because there are breaking changes between lodash 1.3 and 3.x). What problem are you trying to solve? – Jordan Running Dec 09 '15 at 21:35
  • I have updated the question. I know upgrading from 1.3.1 to 1.3.2 will not break any dependency. So in this case how can I upgrade the private_mod to be consistent in my App project. – rohit12sh Dec 09 '15 at 22:03

1 Answers1

0

As per the documentation here, try

npm --depth 9999 update private_mod@version
Anemoia
  • 7,928
  • 7
  • 46
  • 71
  • Thanks! It wasn't available at the time of posting the questions. – rohit12sh Jan 27 '20 at 16:17
  • 1
    That "--depth" is not necessary anymore/not working anymore according to https://github.com/npm/rfcs/blob/latest/implemented/0019-remove-update-depth-option.md – GandalfIX Apr 14 '21 at 13:39