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
- Clear the npm cache and reinstall: npm cache clean --force && npm install
- Delete node_modules and package-lock.json, then reinstall: rm -rf node_modules package-lock.json && npm install
- If the lock file is the issue, regenerate it: delete package-lock.json and run npm install
- 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.
