Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] package-lock.json file inconsistent between different npm install runs #7841

Closed
2 tasks done
json-derulo opened this issue Oct 16, 2024 · 1 comment
Closed
2 tasks done
Labels
Bug thing that needs fixing Duplicate duplicate of another, existing issue

Comments

@json-derulo
Copy link

json-derulo commented Oct 16, 2024

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

The package-lock.json file created during npm install is inconsistent and sometimes generates a lock file which is out of sync

Expected Behavior

The package-lock.json file created during npm install is consistent and generates a lock file which is always in sync

Steps To Reproduce

  1. Clone the following repo: https://github.com/json-derulo/angular-ecmascript-intl

  2. Remove the lock file rm package-lock.json

  3. Run npm install

  4. Run npm ci

    The following error is thrown:

    `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.
    
  5. Run npm install again -> the lock file is changed!

  6. Run npm ci again -> this time it succeeds

Why this is a problem

I am using Renovate to automate the dependency updates, with the lockFileMaintenance option. With this issue, the bot creates an invalid lock file which needs to be manually fixed. I run the bot on several Angular projects and all have this issue.

Environment

  • npm: 10.9.0
  • Node.js: 20.18.0
  • OS Name: MacOS 12.7.6
  • System Model Name: Macbook Pro
  • npm config:
; "builtin" config from /usr/local/lib/node_modules/npm/npmrc

prefix = "/usr/local"

; "user" config from /Users/json-derulo/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = /usr/local/bin/node
; node version = v20.18.0
; npm local prefix = /Users/json-derulo/projects/angular-ecmascript-intl
; npm version = 10.9.0
; cwd = /Users/json-derulo/projects/angular-ecmascript-intl
; HOME = /Users/json-derulo
; Run `npm config ls -l` to show all defaults.
@json-derulo json-derulo added Bug thing that needs fixing Needs Triage needs review for next steps labels Oct 16, 2024
@milaninfy milaninfy added Duplicate duplicate of another, existing issue and removed Needs Triage needs review for next steps labels Oct 16, 2024
@milaninfy
Copy link
Contributor

Closing: this looks to be similar if not a duplicate of an existing issue, #6787. If you believe your instance is unique, please provide further clarifying details.

@milaninfy milaninfy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Duplicate duplicate of another, existing issue
Projects
None yet
Development

No branches or pull requests

2 participants