Shasum check or integrity/EINTEGRITY errors


(Kat Marchán) #1

This is a common issue which used to be caused by caching issues. Nowadays, the cache has been improved, so it’s likely to be an install issue, which can be caused by network problems (sometimes even proxy issues), a node bug, or possibly some sort of npm bug.

Examples

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ== integrity checksum failed when using sha512: wanted sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ== but got sha1-F2n0tVHu3OQZ8FBd6uLiZ2NULTc=. (2982 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-5IlgUgjUahydmA0uV3L6nHXZ7GU= integrity checksum failed when using sha1: wanted sha1-5IlgUgjUahydmA0uV3L6nHXZ7GU= but got sha512-YBaAfimGdWE4nDuoGVKsH89/dkz2hWZ0i8qC+xxqmqi+XJ/aXiRF0jPtzXmN7VdkpVjy1xuDmM5/m1FNuB6VWA==. (4972 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! shasum check failed for C:\Users\some-user\AppData\Local\Temp\npm-9356-7
d74e411\registry.npmjs.org\some-package\-\some-package-1.0.0.tgz
npm ERR! Expected: 652294c14651db29fa93bd2d5ff2983a4f08c636
npm ERR! Actual:   c45474b40e6a7474633ec6f2b0315feaf15c61f2
npm ERR! From:     https://registry.npmjs.org/some-package/-/some-package-1.0.0.tgz

Related Issues


(Kat Marchán) #2

Steps to Fix

  1. Try running npm install again. It may have been a momentary hiccup or corruption during package download.

  2. Check http://status.npmjs.org/ for any potential current service outages.

  3. If the shasum error specifically has Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709, with this exact shasum, it means the package download was empty, which is certainly a networking issue.

  4. Remove your package-lock.json and node_modules and do a fresh install:

    • $ rm -rf package-lock.json node_modules
    • $ npm install
  5. Make sure your network connection and proxy settings are ok.

  6. Update your node and npm versions to the latest stable versions.

  7. Try it again, with a temporary clean cache:

    • $ rm -rf package-lock.json node_modules
    • $ npm install --cache /tmp/empty-npm-cache
    • If this fixes it, clear your global npm cache to fix the corruption.