Skip to content

[BUG] npm-ci failes if dependency with ^ has a new release that satifies #6378

@SvenLie

Description

@SvenLie

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

When a dependency of one of my dependencies has an entry like "semver": "^7.3.4" and i installed it when version 7.4.0 was out. When i then run npm ci all its fine. When the package released in a new version like 7.5.0 npm ci failes with:

npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! 
npm ERR! Invalid: lock file's semver@7.4.0 does not satisfy semver@7.5.0

Expected Behavior

npm ci should install version 7.4.0 of this package

Steps To Reproduce

  1. create an package with version 1.0.0
  2. add this as an dependency of one of your packages with "^1.0.0"
  3. release a new version like 1.1.0
  4. run npm ci in your project with the dependency --> error occurs

Environment

  • npm: 9.6.4
  • Node.js: 18.15.0
  • OS Name: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingCannot ReproduceNeeds Triageneeds review for next stepsRelease 9.xwork is associated with a specific npm 9 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions