Resolve an npm installation issue caused by error code EINTEGRITY

After reviewing numerous similar posts on this platform, I have yet to find a solution. Many suggest using npm cache verify or npm cache clear, but these haven't worked for me.

I even took the extreme step of completely removing npm and node through various methods, including using --force. Unfortunately, nothing has resolved my issue. Below is the latest log in hopes that someone can identify where I may have gone wrong or guide me towards a potential solution.

Here is the most recent log:

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

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 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="026c726f42372c342c32">[email protected]</a>
3 info using <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cea0a1aaab8eb8f6e0f7e0fa">[email protected]</a>
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 <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1a746a775a2f342d342b">[email protected]</a> 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 ]

Answer №1

I was able to fix the issue by executing the following commands:

rm -rf package-lock.json node_modules
npm install

Source

Answer №2

Recently faced a similar issue at my workplace too. It turned out that the package-lock.json file in our main branch was causing trouble due to outdated integrity values. The solution? Simply deleting the package-lock.json file allowed me to successfully run npm install without encountering any EINTEGRITY errors.

I stumbled upon a helpful answer on Stack Overflow regarding this exact issue: Integrity checksum failure while installing API Connect toolkit #apiconnect.

The fix was actually found in a GitHub issue comment related to npm, which can be seen here: https://github.com/npm/npm/issues/16861#issuecomment-305527498

Answer №3

In the event that this issue arises during the initialization of a react-native project, execute the following command:

npm cache clean --force

https://i.stack.imgur.com/Xz418.png

Answer №4

After removing the node_modules and package-lock.json from the solution directory, I executed npm install again which resolved the issue completely.

Answer №5

While many might suggest deleting the package-lock.json file, I believe that may not always be the best solution. Especially when working on older code with specific dependencies, removing it could cause more harm than good.

Instead, a more effective approach would be to swap out the outdated package-lock.json with one from a different branch or previous commit where things were working fine, and then proceed with running npm install.

This method worked wonders for me in resolving the issue at hand.

Answer №6

Verify the npm registry being used both locally and remotely.

I encountered an issue when I unintentionally altered the CI registry and then committed a local package-lock.json file that contained a different registry.
The discrepancy in registries definitely led to a conflict in package signatures, resulting in the problem at hand.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

ERESOLVE encountered issues resolving the dependency tree for a project using .NET Core 3.1 and Vue.js framework

I encountered an issue while trying to build my application. The error message is as follows: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: <a href="/cdn-cgi/l/email-protection" class ...

Every time I attempt to execute the ember CLI command, a SyntaxError pops up and prevents me from continuing

After recently installing Ember, I followed the Getting Started guide on their website to start working on a tutorial project. However, when I attempted to run the ember command, I encountered a strange SyntaxError. An image of the error is attached. I ha ...

Error: The command "SET" was not found in the `npm start` script

I encountered an issue while trying to run a React project. After running the command: npm start, I received the following error: sh: SET: command not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! &l ...

Stop Jade from collapsing the directory hierarchy

When it comes to implementing a build solution using NPM scripts instead of Gulp or Grunt, I have been facing some challenges in managing multiple Jade files efficiently. I've referred to resources like and for guidance. The Jade CLI allows for com ...

Error in electron-builder: Module 'dmg-license' was not found

Seeking a straightforward method to create an electron app for macOS from a Linux machine. Unfortunately, the electron-builder -m command is not functioning properly. Here is the complete output of the command: electron-builder -m • elec ...

The output generated by grunt-contrib-handlebars differs from that of the handlebars npm task

Looking for some help with a problem similar to the one mentioned in this Stack Overflow question. Since that question hasn't been answered yet, I decided to create my own post. I'm currently attempting to precompile my handlebars template files ...

Having trouble with the pagination feature while filtering the list on the vue-paginate node

In my current project, I have integrated pagination using the vue-paginate node. Additionally, I have also implemented filtering functionality using vue-pagination, which is working seamlessly. Everything works as expected when I enter a search term that d ...

What could be preventing my custom package script from running when using "npm run"?

After thoroughly reviewing the documentation: npm run-script <command> [-- <args>...] alias: npm run Executing arbitrary package scripts This command allows for running a custom command specified in a package's "scripts" object. If no s ...

Developing a collection of reusable components in a Javascript bundle for enhanced efficiency

I currently have a backend rendered page (using Django) that I want to enhance by incorporating components from PrimeVue and a markdown editor wrapped as a Vue component. Previously, we utilized some simple animations with jQuery which we included directly ...

Best Practices for Utilizing NPM Modules with TypeScript

I am interested in developing an npm module using TypeScript. Can anyone suggest a best practice guide on how to start? Here are my questions: Node.js does not natively support TypeScript, so what is the recommended way to publish an npm module? Shoul ...

The Continuous React Native Packager Building Loopincrasing Bundle Loop is under

Finished compiling JavaScript bundle in varying times. The project is not located in a synced cloud folder. What could be causing this issue? This issue only occurs on iOS devices (both simulator and physical). Android devices are functioning correctly. ...

Global installation of Node modules

How do I reference globally installed node modules? For example, if I have a package.json file and I choose to install all the node modules listed in it globally (located at C:\Users\MyaccountName\AppData\Roaming\npm), how can I ac ...

The function 'makeDecorator' does not support function calls when being accessed

Resolved by @alexzuza. Check out his solution below - major props! The issue was with the node_modules folder in the ng2-opd-popup directory, it needed to be removed and the src/tsconfig.app.json file had to be adjusted accordingly. Make sure to also refer ...

The app is opening the index.html file instead of the expected index.jsx file

After creating a page with React.jsx, I encountered an issue where my page was initially opening index.jsx upon running npm start. However, when I deleted and then restored the index.html file to "public", the page started opening index.html instead. This ...

A Step-by-Step Guide to Setting Up and Utilizing V-Calendar in Vue.js

I am currently trying to incorporate the V-Calendar library into my Vuetify application. Up until now, the app was working fine, but I seem to have hit a roadblock with the correct installation of the V-Calendar library. Although no error messages are bei ...

Leveraging the angular-in-memory-web-api in conjunction with Angular CLI

Encountering some frustrating issues while trying to integrate angular-in-memory-web-api into my Angular 2 project that was built using Angular CLI. Here's the current structure of dependencies inside my package.json: "dependencies": { "@angular/co ...

What is the function of the npm remove command?

This is my first time using nodejs/npm. I attempted to uninstall reactjs from my system by typing npm remove reactjs@xxx. However, the output I received seemed strange, prompting me to research the command further. Much to my surprise, it turns out that `r ...

Runtime not able to identify new modifications post migration from Angular 2 to Angular 6

I successfully upgraded my Angular 2 project with DotNetCore to Angular 6 by executing the following command: npm install -g npm-check-updates ncu -u After completing the migration process, I found that while I can still run my previously developed proje ...

Challenges with Installing Packages Using npm Command

Every time I attempt to install node_modules using the command npm i or npm install, I encounter the following error messages: npm ERR! network If you are behind a proxy, please ensure that the 'proxy' config is properly set. See: 'npm help ...

Oops! Looks like we encountered a problem: "Uncaught ReferenceError: process is not

As I work on my project utilizing angular 6 with Spring-boot, I have encountered an error that I am struggling to resolve. Specifically, the error message reads: Uncaught ReferenceError: process is not defined at Object../node_modules/util/util.js (ut ...