Reputation: 306
Let's say we have 3 packages with the following dependencies:
C -> B@^1.0.0 and B -> A@^1.0.0
(module C depends only on module B version 1.0.0 and above; module B depends on module A version 1.0.0 and above;)
Now I'm doing the following steps:
But, if i'm cleaning node_modules and then npm-install module C again, i'm getting that node_modules contains A@^1.0.1 and B@^1.0.0
Upvotes: 1
Views: 144
Reputation: 276306
npm update
respects semantic versioning, it will not update major versions of packages if you have a ^
dependency.
^
on a dependency literally means that it's only fine to update up to a minor version - since major versions contain breaking changes.
This command will update all the packages listed to the latest version (specified by the tag config), respecting semver.
From the docs
Upvotes: 0