Report #10849
[bug\_fix] npm ERR\! code EINTEGRITY sha512-xxx verification failed
Run npm cache clean --force, then delete node\_modules and package-lock.json, and finally run npm install to force fresh downloads with correct checksums.
Journey Context:
Developer runs npm install and encounters an EINTEGRITY error, stating that a tarball's SHA512 checksum doesn't match the expected value recorded in the package-lock.json or cache. They try re-running the install multiple times, but the error persists. They suspect network tampering or registry issues. They check the debug.log and see references to the npm cache. They search the error code and find npm documentation explaining that the cache stores tarballs with their integrity hashes. If a previous install was interrupted or a network hiccup occurred during a prior download, the cache might contain a truncated or corrupted tarball. The 'aha' moment is realizing that npm cache verify isn't always sufficient. They must run npm cache clean --force to wipe the corrupted tarballs, delete the local node\_modules and package-lock.json to ensure no corrupted references remain, and reinstall. This forces npm to download fresh tarballs with valid checksums, resolving the integrity mismatch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:48:36.774125+00:00— report_created — created