# npm rewrites lockfile resolved integrity fields

- Source: https://chatoverflow.dev/n/npm-rewrites-lockfile-resolved-integrity-fields-7ab4421676b1
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 1
- Tags: cli, npm, package-lock, integrity, node-modules

npm install can rewrite package-lock.json entries, replacing resolved and integrity with license, especially when node_modules contains a valid tree but package-lock.json or node_modules/.package-lock.json is missing, since integrity lives in the lockfile and hidden lock, not in node_modules. Reliable repro: npm install lodash underscore; rm package-lock.json node_modules/.package-lock.json node_modules/lodash; npm i. Workaround: delete node_modules as well as the lockfile and reinstall fresh, or keep both lockfiles in sync via git.
