Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is npm throwing the error "checksum failed while installing @angular/cli"?

I'm using node v6.11.5 and npm 3.10.10 and 64-bit OS, and while installing @angular/cli I'm getting the following error:

C:\WINDOWS\system32>npm install -g @angular/cli
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10

npm ERR! shasum check failed for C:\Users\Shubham\AppData\Local\Temp\npm-6192-9e
acb63c\registry.npmjs.org\rxjs\-\rxjs-5.5.2.tgz
npm ERR! Expected: 28d403f0071121967f18ad665563255d54236ac3
npm ERR! Actual:   c2b697120c7dc0e6728da0e7636b90e15723cc24
npm ERR! From:     http://registry.npmjs.org/rxjs/-/rxjs-5.5.2.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WINDOWS\system32\npm-debug.log

I'm trying to solve this since last night, but each time this shasum check failed is all I'm getting. I tried the following things:

  1. I configured the npm registry to both http and https. Didn't worked.
  2. Checked the path OS path variables, and the directory where node is installed. Found nothing.
  3. Tried to clean npm and uninstalling and installing angular/cli. Didn't worked.
like image 759
snegi Avatar asked Oct 28 '17 07:10

snegi


People also ask

Why is my npm install failing?

The error in NPM, 'error package install failed, see above', can occur when the user creates a new project in Angular using Node. js using VS code. This means that NPM is corrupted in your system, and must reinstall NPM.


Video Answer


4 Answers

Local setup issues are tough to debug as there's a lot of trial and error, keeping a list of what you've tried and resulting outcomes.

This is an attempt at a list of suggestions. I suspect you've tried many of these, I hope this helps organize your efforts.

  1. Verify npm registry: npm get registry (expect: https://registry.npmjs.org/)
  2. Update npm to latest: npm install npm@latest -g
  3. Remove package-lock.json
  4. Uninstall npm completely before reinstalling, including npm and npm-cache directories: sudo npm uninstall npm -g
  5. Uninstall node completely (including npm again) and reinstalling

Along the way, I did come across similar github issues:

  • integrity checksum failed when using sha1 - Node v8+ (see comment)

Hi @Rogasch I will suggest you to completely uninstall node and npm. Also delete npm and npm-cache folder. And reinstall using node-v6.11.2-x86.msi installer. 👍 3 ❤️ 1

i had the same issue and npm install -g npm fixed it for me

I got this problem when I got package-lock.json included in the commit. After removing package-lock.json I could run npm install without errors again.

  • npm WARN registry Unexpected warning for https://registry.npmjs.org/ (OPEN)
like image 193
stealththeninja Avatar answered Oct 19 '22 15:10

stealththeninja


I deleted the file package-lock.json and re-ran npm install.

like image 45
jaycer Avatar answered Oct 19 '22 15:10

jaycer


it's a build problems on windows, try these steps:

npm install -g node-gyp

npm install --global windows-build-tools

npm install -g angular-cli
like image 40
Fateh Mohamed Avatar answered Oct 19 '22 15:10

Fateh Mohamed


On our Ubuntu 18.04, we just needed to do the following:

npm install npm@latest -g
like image 35
xameeramir Avatar answered Oct 19 '22 15:10

xameeramir