18

I have browsed through various similar posts here to no avail. They all arrive at similar solutions about using npm cache verify or npm cache clear, etc.

I have even went as far as to completely remove npm and node using every possible method and start fresh. I even resorted to using --force. Nothing has worked. I am sharing the latest log in hopes someone can point out my oversite or at least direct me to a possible solution.

I am sharing the latest log below.

========================================================================

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'i',
1 verbose cli   'npm',
1 verbose cli   '-g',
1 verbose cli   '--force' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 warn using --force I sure hope you know what you are doing.
5 verbose npm-session 9e6a63471e97c268
6 silly install loadCurrentTree
7 silly install readGlobalPackageData
8 http fetch GET 200 https://registry.npmjs.org/npm 151ms
9 silly pacote tag manifest for npm@latest fetched in 302ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 silly resolveWithNewModule npm@5.7.1 checking installable status
15 silly pacote trying https://registry.npmjs.org/npm/-/npm-5.7.1.tgz by hash: sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA==
16 silly pacote data for sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA== not present. Using manifest.
17 verbose stack Error: sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA== integrity checksum failed when using sha512: wanted sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA== but got sha512-iBtbJV6DQB9dnO+DHun+8z2zKH2zz8pd5nJQL1NNwCxzeYJnSKIa/pmkgRHxYDIhEkRUKbm8wVdQuwxnaL5jhg==. (2162194 bytes)
17 verbose stack     at Transform.on (/usr/local/lib/node_modules/npm/node_modules/ssri/index.js:275:19)
17 verbose stack     at emitNone (events.js:111:20)
17 verbose stack     at Transform.emit (events.js:208:7)
17 verbose stack     at endReadableNT (_stream_readable.js:1055:12)
17 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
17 verbose stack     at process._tickCallback (internal/process/next_tick.js:180:9)
18 verbose cwd /Users/jasongribble
19 verbose Darwin 16.7.0
20 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "npm" "-g" "--force"
21 verbose node v8.9.4
22 verbose npm  v5.6.0
23 error code EINTEGRITY
24 error sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA== integrity checksum failed when using sha512: wanted sha512-r1grvv6mcEt+nlMzMWPc5n/z5q8NNuBWj0TGFp1PBSFCl6ubnAoUGBsucYsnZYT7MOJn0ha1ptEjmdBoAdJ+SA== but got sha512-iBtbJV6DQB9dnO+DHun+8z2zKH2zz8pd5nJQL1NNwCxzeYJnSKIa/pmkgRHxYDIhEkRUKbm8wVdQuwxnaL5jhg==. (2162194 bytes)
25 verbose exit [ 1, true ]
Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54
GingerSwag
  • 199
  • 1
  • 1
  • 5
  • "I have even went as far as to completely remove npm and node" -> You mean you tried to remove the "node_modules" folder in your project? – Milan Tenk Mar 04 '18 at 07:41
  • I should have been specific. Not only a project but globally. Even searched for all node modules and npm folders. I wanted it wiped from the entire system. This EINTEGRITY error has been baffled. – GingerSwag Mar 04 '18 at 09:13
  • Did it work some days ago on the same computer and suddenly something messed it up or you installed NodeJS with npm and from the beginning it did not work? – Milan Tenk Mar 05 '18 at 06:13
  • I was getting the same eror. but "npm cache verify" worked in my case. – MdFarzan Nov 10 '20 at 12:48

6 Answers6

19

Running these commands solved my problem:

rm -rf package-lock.json node_modules
npm install

Reference

Das_Geek
  • 2,775
  • 7
  • 20
  • 26
Kodali444
  • 1,283
  • 1
  • 17
  • 21
16

I just experienced this issue as well at work. The cause was that the package-lock.json file in our master branch was outdated, containing old integrity values. By deleting the package-lock.json file, I was able to run npm install and had no more EINTEGRITY errors.

I found the answer to this problem in another SO post: Integrity checksum failure while installing API Connect toolkit #apiconnect.

They came up with the answer via this GitHub issue comment for npm: https://github.com/npm/npm/issues/16861#issuecomment-305527498

Jeff Peterson
  • 161
  • 1
  • 6
6

If this error occurs during the project creation in react-native, then run:

npm cache clean --force

double-beep
  • 5,031
  • 17
  • 33
  • 41
vishal rathod
  • 187
  • 2
  • 5
1

I deleted node_modules, the package-lock.json in the solution folder, then I re ran npm install, it perfectly worked for me.

depperm
  • 10,606
  • 4
  • 43
  • 67
0

I see a lot of people suggesting to remove package-lock.json file but I think deleting it is not a very good solution, especially if you are working on code that was written a long time back, it has very specific versions of dependencies, without which code might not run properly.

A better solution, if possible, is to replace the old package-lock.json with one from another working branch or a previous working commit, and then run npm install.

That seemed to have solved the issue for me.

0

Check about the npm registry you used local and remote.

My problem was that I changed the CI registry and committed a local generated package-lock.json which has a different registry.
The different registry is surely has the different signature of the package which caused this issue.