5

When I try to make npm install, I got this error

  npm ERR! code EINTEGRITY
    npm ERR! 
    sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA== 
    integrity checksum failed when using sha512: wanted sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA== but got sha5
        12-jGhWI9FADblpQKmyQF4BghrHs6FLV3dYFHVWcvj0xIUzHuO41PPfUlZOUplwasz72FRE2Knsa0wWubWldC9Jpw==. (3240 bytes)
        npm WARN tar invalid entry
        npm WARN tar invalid entry
        npm WARN tar invalid entry
        npm WARN tar invalid entry
        npm WARN tar invalid entry
        npm WARN tar invalid entry

I tried,

npm cache verify
npm cache clean --force

I have already delete package-lock.json file,

Add proxy to .npmrc and other confs like strict-ssl=false, NODE_TLS_REJECT_UNAUTHORIZED=0

versions :

npm version
{ npm: '6.11.3',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  http_parser: '2.8.0',
  icu: '64.2',
  modules: '64',
  napi: '4',
  nghttp2: '1.39.2',
  node: '10.16.3',
  openssl: '1.1.1c',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.28.0',
  v8: '6.8.275.32-node.54',
  zlib: '1.2.11' }

node -v
v10.16.3
İlyas Şahin
  • 293
  • 2
  • 3
  • 9
  • You should provide deails of the npm version, and the contents of your package.json. Did you try to identify which package is actually giving an error. Maybe the recent packages that you added is causing a problem. – Alok Swain Sep 18 '19 at 10:29
  • C:\Users\I_SAHIN15>npm version { npm: '6.11.3', ares: '1.15.0', brotli: '1.0.7', cldr: '35.1', http_parser: '2.8.0', icu: '64.2', modules: '64', napi: '4', nghttp2: '1.39.2', node: '10.16.3', openssl: '1.1.1c', tz: '2019a', unicode: '12.1', uv: '1.28.0', v8: '6.8.275.32-node.54', zlib: '1.2.11' } C:\Users\I_SAHIN15>node -v v10.16.3 – İlyas Şahin Sep 18 '19 at 10:31
  • did you check this question? https://stackoverflow.com/questions/47545940/when-i-run-npm-install-it-returns-with-err-code-eintegrity-npm-5-3-0 – GrafiCode Sep 18 '19 at 11:18
  • Yes, I have already checked related question but it has't work for me. – İlyas Şahin Sep 19 '19 at 05:19
  • @İlyasŞahin Have you find any solution to this? – Beauceron Aug 06 '20 at 16:01
  • @Beauceron yes, resolved. ıt was all relevant with internet connection, after some firewall configuration its solved. – İlyas Şahin Aug 18 '20 at 10:43

3 Answers3

3

Here is the solution that worked for me:

  1. Delete node_modules folder and package-lock.json

    rm -rf node_modules package-lock.json

  2. Install npm

    npm install

Anish Sapkota
  • 774
  • 9
  • 19
2

You deleted package-lock.json, so the following would probably be of no use for you. In my case it worked. But first make sure you understand what's going on. npm tells you that the checksum from https://registry.npm.org doesn't match the one from package-lock.json. Either it changed in the registry, or...

Consider a line from the output:

npm ERR! 
  sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA== 
integrity checksum failed when using sha512: wanted
  sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==
but got
  sha512-jGhWI9FADblpQKmyQF4BghrHs6FLV3dYFHVWcvj0xIUzHuO41PPfUlZOUplwasz72FRE2Knsa0wWubWldC9Jpw==
. (3240 bytes)

Find the package in package-lock.json by the first two integrity checksums (sha512-b...), and put the third one (sha512-j...) into its "integrity" field.

More on it here.

x-yuri
  • 16,722
  • 15
  • 114
  • 161
0

In case my case, I found the conflict coming from private proxy repository after I try all these suggestions around internet.

If you also downloaded npm package via a private repository(e.g. Sonatype Nexus). You should find the conflict packages and delete it from your proxy repository. I guest the same version packages of main repository have been updated but proxy repository cache the previous update.

I fixed it by deleted the entire folder of package"@babel" screen shot

Jason
  • 36
  • 3