npm update packages recursively
Asked Answered
R

1

7

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

Rooster answered 9/12, 2015 at 21:26 Comment(2)
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?Iiette
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.Rooster
D
0

As per the documentation here, try

npm --depth 9999 update private_mod@version
Dangerous answered 26/1, 2020 at 6:1 Comment(2)
Thanks! It wasn't available at the time of posting the questions.Rooster
That "--depth" is not necessary anymore/not working anymore according to github.com/npm/rfcs/blob/latest/implemented/…Strawn

© 2022 - 2024 — McMap. All rights reserved.