Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The issue #3403 still exists.
The command npm version <version> --workspaces does not update the dependencies nor the devDependencies in the package.json file.
As documented here, the fix provided at the time unfortunately does not work: #4588 (comment)
Expected Behavior
npm version 2.0.0 --workspaces should update all workspace package versions (currently does) and also update the package.json dependencies and devDependencies versions.
Steps To Reproduce
- Setup a new npm workspace
- Create /packages/package-a with
package.json:
{
"name": "package-a",
"version": "1.0.0"
}
- Create /packages/package-b with
package.json:
{
"name": "package-b",
"version": "1.0.0",
"dependencies": {
"package-a": "1.0.0"
}
}
- Run
npm version 2.0.0 --workspaces
- Notice the package versions are updated but the dependencies are not.
Environment
- npm: 10.8.3
- Node.js: 22.9.0
- OS Name: macOS 14.7
- System Model Name: MacBook Pro
- npm config:
❯ npm config ls
; "user" config from /Users/xxx/.npmrc
@company:registry = "https://npm.pkg.github.com"
//npm.pkg.github.com/:_authToken = (protected)
; node bin location = /Users/xxx/.nodenv/versions/22.9.0/bin/node
; node version = v22.9.0
; npm local prefix = /Users/xxx/Repositories/test
; npm version = 10.8.3
; cwd = /Users/xxx/Repositories/test
; HOME = /Users/xxx
; Run `npm config ls -l` to show all defaults.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The issue #3403 still exists.
The command
npm version <version> --workspacesdoes not update the dependencies nor the devDependencies in the package.json file.As documented here, the fix provided at the time unfortunately does not work: #4588 (comment)
Expected Behavior
npm version 2.0.0 --workspacesshould update all workspace package versions (currently does) and also update the package.json dependencies and devDependencies versions.Steps To Reproduce
package.json:{ "name": "package-a", "version": "1.0.0" }package.json:{ "name": "package-b", "version": "1.0.0", "dependencies": { "package-a": "1.0.0" } }npm version 2.0.0 --workspacesEnvironment