Search code examples
node.jsnpmdependenciesnpm-shrinkwrap

npm update packages recursively


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


Solution

  • As per the documentation here, try

    npm --depth 9999 update private_mod@version