Is there an existing issue for this?
This issue exists in the latest npm version
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
-
Clone the following repo: https://github.com/json-derulo/angular-ecmascript-intl
-
Remove the lock file rm package-lock.json
-
Run npm install
-
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.
-
Run npm install again -> the lock file is changed!
-
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.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The
package-lock.jsonfile created duringnpm installis inconsistent and sometimes generates a lock file which is out of syncExpected Behavior
The
package-lock.jsonfile created duringnpm installis consistent and generates a lock file which is always in syncSteps To Reproduce
Clone the following repo: https://github.com/json-derulo/angular-ecmascript-intl
Remove the lock file
rm package-lock.jsonRun
npm installRun
npm ciThe following error is thrown:
Run
npm installagain -> the lock file is changed!Run
npm ciagain -> this time it succeedsWhy this is a problem
I am using Renovate to automate the dependency updates, with the
lockFileMaintenanceoption. 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