Skip to content

[BUG] npm version with workspace will not write new data back to package-lock.json #4193

@zthxxx

Description

@zthxxx

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

  1. run npm version for workspaces with -w <workspace> args
  2. see only changed package.json but not change lockfile

Expected Behavior

run npm version -w <workspace> need adjust new version of workspace package in package-lock.json

As it said in npm cli docs:

Run this(npm version) in a package directory to bump the version and write the new data back to package.json, package-lock.json, and, if present, npm-shrinkwrap.json.

image

Steps To Reproduce

  1. run npm version for workspaces with -w <workspace> args
  2. see only changed package.json but not change lockfile
  3. for verify whether lockfile need update, I have run npm install
  4. yes, lockfile changed

image

image

Environment

  • npm: 8.3.0
  • Node: 16.8.0
  • OS: macOS 11.15
  • platform: Mac
  • npm config:
audit = false
fund = false
if-present = true
ignore-scripts = false
yes = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions