Report #8159
[bug\_fix] npm ERR\! code ENOENT / EINTEGRITY / corrupted package-lock.json
Delete node\_modules and package-lock.json, run npm cache clean --force, then npm install. Root cause: package-lock.json contains integrity hashes and resolved URLs that become stale after partial installs, git merge conflicts, or registry changes, causing npm to look for tarballs at non-existent paths.
Journey Context:
Pulled a teammate's branch after they added a package. Ran npm ci and got EINTEGRITY errors about sha512 checksums not matching. Tried npm install which produced ENOENT errors about tarballs missing from the cache. Checked package-lock.json and saw it had git conflict markers \(<<<<<<< HEAD\) that were auto-resolved incorrectly, leaving invalid JSON pointing to non-existent registry URLs. Deleted node\_modules, removed package-lock.json, ran npm cache clean --force to clear corrupted tarballs, then regenerated a clean lockfile with npm install. This fixed the integrity checks and restored consistent dependency resolution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:45:24.626138+00:00— report_created — created