If I update a dependency manually in the package.json
or "automatically" (by installing a package through npm CLI) both methods do not update the package-lock.json
leaving me with a broken npm ci
build (inconsistencies between package.json
and package-lock.json
not allowed).
- NPM version 10.2.3
- Ubuntu 22.04.3 LTS
- We are working on an Angular/TypeScript project.
Things I have tried without a package-lock.json
being updated (or created for that matter):
npm install --save-dev webpack
- manually set the dependency in my
package.json
and runnpm install
- try other commands such as
ng build <project> --configuration <any-env>
ornpm i
ornpm audit fix
etc. - repeat any of the above commands with or without
npm_modules
and/ordist
folder removed
My colleague, on macOS, does see updates of the package-lock.json
file with npm install
after manually changing a dependency in the package.json
and I cannot figure out why.
I have read and tried solutions in the following topics without resolving:
- package-lock.json not updated after removing a package from package.json?
- Why does "npm install" rewrite package-lock.json?
- npm update is not updating the version in package.json file
- package.json and package-lock.json does not reflect node_module's versions
- package-lock.json is rewritten after npm install
TLDR: well this is embarrassing; don't have a
package-lock=false
in your.npmrc
. The end.