İlyas Şahin
İlyas Şahin

Reputation: 323

npm ERR! code EINTEGRITY while npm install

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

Upvotes: 6

Views: 15178

Answers (3)

Jason
Jason

Reputation: 46

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

Upvotes: 0

Anish Sapkota
Anish Sapkota

Reputation: 814

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

Upvotes: 3

x-yuri
x-yuri

Reputation: 18983

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.

Upvotes: 2

Related Questions