Skip to content

[BUG] npm update --dry-run is bloken #9187

Closed

Description

@zdm

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. It update node_modules/.package-lock.json event if --dry-run option is provided.
  2. It produce text and json output if --dry-run is specified.

Expected Behavior

I am expecting that no changes will be performed in dry-run mode.

I am expecting clear json output.

Steps To Reproduce

  1. Run npm up --dry-run --json
  2. See text + json output
  3. Run npm up --dry-run --json once more
  4. See nothing, this is because .package-lock.json was updated

Environment

  • npm: 11.12.1
  • Node.js: v24.14.1
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    on Apr 3, 2026
  2. v-kchindam-infy commented on Apr 3, 2026

    @v-kchindam-infy

    Closing: this looks to be similar if not a duplicate of an existing issue #8565 . If you believe your instance is unique, please provide further clarifying details.Please feel free to open the issue persists again

  3. zdm commented on Apr 3, 2026

    @zdm
    Author

    Mentioned issue is related to json output.
    My issue is also about --dry-run make unexpected updates.

    I have no permissions to re-open issue.

  4. zdm commented on Apr 6, 2026

    @zdm
    Author

    @kchindam-infy Could you please reopen it?

  5. added
    Priority 2secondary priority issue
    and removed
    Needs Triageneeds review for next steps
    on Apr 7, 2026
  6. cjanssen commented on May 14, 2026

    @cjanssen

    Can confirm this as well using version 11.8.0. Any call to npm with --dry-run results in changes occuring in the node_modules/.package_lock. Subsequent calls of the same dry run command return 'up to date.'

  7. martinrrm commented on Jul 30, 2026

    @martinrrm
    Contributor

    This has been fixed by #9395 and was released in 11.16.0, please try that version and let us know if the issue is still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions