What you see
npm ERR! code EINTEGRITY
npm ERR! sha512-... integrity checksum failed when using sha512: wanted sha512-AAAA... but got sha512-BBBB...Common causes
- A corrupted entry in the local npm cache, often from an interrupted download.
- A proxy or mirror that rewrote or re-packed the tarball.
- A lockfile edited by hand or merged badly, with an integrity value from a different version.
- Very rarely, a tarball that really changed upstream.
How to fix it
- 01
Verify the local cache
npm can check and repair its cache. This fixes the most common cause.
shell npm cache verify npm ci - 02
Check the lockfile entry
Compare the integrity value in package-lock.json with the one the registry publishes.
shell npm view react@19.1.0 dist.integrity - 03
Do not delete the lockfile to make it go away
Regenerating the lockfile accepts whatever bytes the network delivers today. Find which package fails first.
shell npm ci --loglevel verbose 2>&1 | grep -i integrity