Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kchindam-infy committed Jan 10, 2025
1 parent 66ce190 commit c17fe63
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docs/lib/content/commands/npm-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,15 @@ When using `npm workspaces`, you might have multiple packages that depend on one

#### Note on `--save`
By default, `npm version -ws` will bump the versions in each workspace without automatically
updating dependency references across workspaces. Including the `--save` flag triggers a
minimal reify operation that updates references **if** your semver range allows it.
updating dependency references across workspaces. Including the `--save` flag ensures that dependency
references are updated when the sember range allows it.

For example, if a dependency is declared as `^1.0.2`, a minor bump from `1.0.2` to `1.1.0`
is valid under the caret range, so npm updates the reference to `^1.1.0`. However,
moving from `1.x.x` to `2.x.x` is outside of the caret range. In that case,
you must broaden the range (e.g., `">=1.0.0 <3.0.0"`, `"^1.0.0 || ^2.0.0"`, etc.) or
manually update it to allow a major bump.

It's important to note, Reify takes place even without the `--save` flag. However, in that case,
package.json is not modified to reflect updated dependency references.

### See Also

* [npm init](/commands/npm-init)
Expand Down

0 comments on commit c17fe63

Please sign in to comment.