NPM Install Failure: EINTEGRITY

npm ERR! code EINTEGRITY

npm ERR! Verification failed while extracting handlebars@4.0.14:

npm ERR! Verification failed while extracting handlebars@4.0.14:

npm ERR! sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== integrity checksum failed when using sha512: wanted sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== but got sha512-E7tDoyAA8ilZIV3xDJgl18sX3M8xB9/fMw8+mfW4msLW8jlX97bAnWgT3pmaNXuvzIEgSBMnAHfuXsB2hdzfow==. (596920 bytes)

Everything goes fine up until its half way of dependencies installation until I reach this error. Does anyone notice this error? If then, how did you resolve it?

1 Like

Try to delete package-lock.json and run yarn

2 Likes

that fixed some of the issues I had, but what I also needed to do was to run nodemon instead of npm start

for some reason nodemon was installed at c:\nodemon, I tried npm install --save nodemon to install it specifically at mflix enviroment but to no avail … so entering nodemon made something happen … I will see if that something is enough

–edit I
now when I want to run jest by doing npm test -t mongoclient in my shell it checks for C:\jest\bin\jest.js
there is something wrong with my enviroment … any ideas for quick fix? before a full dive in :slight_smile:

–edit II
I set up yarn and ran that as well, installed jest and ran db-connection test, it failed, even thou I have set my .env file correctly up (how many things can go wrong there ? added course default pass and user, inserted the string provided from atlas cluster, verified it to be working with mongo shell client and mongo compass (fyi did this for verification:

  1. connected to my atlas cluster (success)
  2. verified mflix dbs where in fact with default dataset : show dbs (success)
  3. switched to sample_mflix dbs use sample_mflix (success) <— hint this is probable the problem (that sample_ prefix)
  4. checked if once upon a time in mexico is there: db.movies.find({“title”: "Once Upon a Time in Mexico},{title: 1}).pretty() (success)(*you can skip that pretty() but it is a old habit)
    )
    After standing up fetching something to drink, I noticed that I had duplicate mflix thing, one only named mflix and had some data that was auto created most likely by the test, I dropped that collection. After that I went to .env file and added sample_ in front of mflix … that got 2 of my tests to succeed. But my unit test expected 45kish+ movies and after running a quick count on my current dataset I only had 20kish movies on the cluster, which happen to be what my test told me anyways( db.movies.find().count() )

I thought I could use sample data on atlas cluster, but it seems according to above data that I am wrong, I need to drop the database and restore it, will do that tomorrow. But please correct me if I am wrong, I am new to mongo :blush:

Though we can ignore warnings but shall we run npm audit fix ?

added 1057 packages from 1190 contributors and audited 42792 packages in 62.723s
found 124 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details

Thanks

It worked like magic. Mind if I ask as to why and how your method worked? I am confused as to why I have encountered such error with package.lock.json.
Also, thank you very much for your solution.

It took me 5 hours to get this exact situation resolved. This is one of the issues I have with JS libraries is that dependency creep can be problematic. I’m on a MAC running NVM with multiple Node versions for these particular use cases.

I ran through all of the process, deleted package-lock.json and that still didn’t work.

I literally had to rebuild my Node JS ver10.16.3 environment along with an NPM update and NPM cache clear (–force), then deleted package-lock.json and it still took two tries before the server got up and running. There are still Audit fixes and file deprecations as well.

This situation has lowered my overall confidence in what is still ahead in the course material.

2 Likes

To resolve this I deleted the package-lock.json file, ran npm audit fix and npm install.

3 Likes