EINTEGRITY 📦 npm

npm ERR! code EINTEGRITY — sha512 integrity checksum failed

A downloaded package’s hash doesn’t match the integrity value in package-lock.json — a corrupted cache, a changed tarball, or a lockfile from a different registry.

Seen on: npm

Meaning

npm verifies every tarball against the lockfile’s integrity field. Mismatches come from a corrupted local cache, a registry mirror serving different tarballs, or lockfiles edited/merged incorrectly.

Common causes

  • Corrupted npm cache
  • Lockfile generated against a different registry/mirror
  • Bad merge in package-lock.json
  • Proxy modifying downloads

⚡ Quick fix

  1. npm cache verify (or npm cache clean --force)
  2. Delete node_modules and reinstall with npm ci
  3. Regenerate the lockfile if it was hand-merged
  4. Use the same registry for everyone (commit .npmrc)

Detailed fix by platform

npm

  1. Clean and reinstall:
    bash
    npm cache verify
    rm -rf node_modules
    npm ci

How to diagnose

  1. Package — Which tarball fails?
  2. Registry — Same registry as the lockfile?
  3. Cache — Does a clean cache fix it?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.