I have tried for many times but still this error (shasum check failed)
4784 error Error: shasum check failed for C:\Users\FENGXI~1\AppData\Local\Temp\npm-7004-QbpFFte5\1387269030233-0.28223602287471294\tmp.tgz
4784 error Expected: dee5a33ff04d7217194dc1ad1342e3a441761942
4784 error Actual: ab7d89ca1f31db14db047d01222dd968649cfb50
4784 error at C:\Program Files\nodejs\node_modules\npm\node_modules\sha\index.js:38:8
4784 error at ReadStream.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\sha\index.js:85:7)
4784 error at ReadStream.EventEmitter.emit (events.js:117:20)
4784 error at _stream_readable.js:920:16
4784 error at process._tickCallback (node.js:415:13)
4785 error If you need help, you may report this *entire* log,
4785 error including the npm and node versions, at:
4785 error <http://github.com/isaacs/npm/issues>
4786 error System Windows_NT 6.1.7600
4787 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
4788 error cwd D:\environment\phonegap
4789 error node -v v0.10.23
4790 error npm -v 1.3.17
Just had the same issue. Type:
$ npm install [URL]
with the URL right before the shasum check fails. After that run your install command again and everything should go on.
eg. for Cordova it was:
$ npm install https://registry.npmjs.org/npm/-/npm-1.3.19.tgz
The root cause of this is fixed. Please do not take the advice in this thread and hack your way around checksum errors, ever. If something has a busted checksum, it's not to be trusted. At best, it's broken; at worst, it's maliciously hacked. Either way, it's not a good sign, and the error is the system working.
As @isaacs says mostly it will mean a corrupt package. In my case that was not the issue. What it worked for me was:
First, try:
npm set registry https://registry.npmjs.org/
and re-install what you was trying to install
Another workaround, use the npm mirror:
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
you can reset this later with
npm set registry https://registry.npmjs.org/
then use it normally:
npm install [...]
Note: thanks to hassanmaher
in https://github.com/npm/npm/issues/2701#issuecomment-40927831
Just reinstall, sometimes due to network problem. Once any module pack is uncompleted, shasum error will be throw. Please reinstall until successes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With