From c17fe6344581531d7e3feccfd5b516870b471829 Mon Sep 17 00:00:00 2001 From: kchindam-infy Date: Fri, 10 Jan 2025 10:21:17 -0800 Subject: [PATCH] resolve comment --- docs/lib/content/commands/npm-version.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/lib/content/commands/npm-version.md b/docs/lib/content/commands/npm-version.md index 1d1971e288cc8..49433a6ba227e 100644 --- a/docs/lib/content/commands/npm-version.md +++ b/docs/lib/content/commands/npm-version.md @@ -123,8 +123,8 @@ 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, @@ -132,9 +132,6 @@ 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)