ProjectStack
npm

npm ERR! code EINTEGRITY — sha512 integrity check failed

The downloaded package file doesn't match the checksum stored in your package-lock.json. This usually means a corrupted download or a mismatch between lock file and registry.

Common causes

  • The npm cache has a corrupted copy of the package
  • The package was republished to the registry with different content (rare but happens)
  • package-lock.json was manually edited and the integrity hash is wrong
  • Network corruption during download

How to fix it

  1. Clear the npm cache and reinstall: npm cache clean --force && npm install
  2. Delete node_modules and package-lock.json, then reinstall: rm -rf node_modules package-lock.json && npm install
  3. If the lock file is the issue, regenerate it: delete package-lock.json and run npm install
  4. Check if you're behind a proxy that might be modifying downloads

Example

npm ERR! code EINTEGRITY npm ERR! sha512-abc123...== integrity checksum failed when using sha512: wanted sha512-xyz789...== but got sha512-abc123==. (1 bytes)

Running npm install when the npm cache contains a corrupt package tarball

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.