WSL icon indicating copy to clipboard operation
WSL copied to clipboard

npm: SHA Checksum fails, tar files modified?

Open peterjuras opened this issue 10 years ago • 17 comments

I have an issue when installing npm packages, it appears that the sha1 checksum verification fails. Is this due to a modification to the tar files or a different issue? Installing on plain Ubuntu works.

To replicate:

  1. Try to install npm: curl -L https://www.npmjs.com/install.sh | sh
  2. It will error out on a dependency installation:
> node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make doc-clean && make -j4 doc

npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/tmp/npm.158/package/cli.js" "install" "-gf"
npm ERR! node v5.11.0
npm ERR! npm  v3.8.9

npm ERR! shasum check failed for /tmp/npm-200-dfb4562b/registry.npmjs.org/hoek/-/hoek-2.16.3.tgz
npm ERR! Expected: 20bb7403d3cea398e91dc4710a8ff1b8274a25ed
npm ERR! Actual:   87cd98ad78a83e428a59bba650f85b2cfd709fc7
npm ERR! From:     https://registry.npmjs.org/hoek/-/hoek-2.16.3.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!     /tmp/npm.158/package/npm-debug.log
It failed
➜  ~

The same issue occurs when npm is already installed and you try to install another package.

peterjuras avatar May 12 '16 07:05 peterjuras

same here. just installed node, npm; then tried to install gulp via command line and here's the output:

npm install --global gulp-cli
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "gulp-cli"
npm ERR! node v4.4.4
npm ERR! npm  v2.15.1

npm ERR! shasum check failed for /tmp/npm-20-e7d51d4e/registry.npmjs.org/gulp-cli/-/gulp-cli-1.2.1.tgz
npm ERR! Expected: 9fd52c50e44fe8eb04a54b3cee23d4a021e3fd3d
npm ERR! Actual:   1950487149d0d76267a7c9d81f345fc9ad6087f4
npm ERR! From:     https://registry.npmjs.org/gulp-cli/-/gulp-cli-1.2.1.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!     /home/cmsv/npm-debug.log

emrecamasuvi avatar May 12 '16 09:05 emrecamasuvi

Same here (v6 of node):

npm ERR! Please include the following file with any support request:
npm ERR!     /home/gordon/git/Visualization/npm-debug.log
gordon@DELL-XPS-15:~/git/Visualization$ npm install -g gulp
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "gulp"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6

npm ERR! shasum check failed for /tmp/npm-1079-e4e4f4af/registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz
npm ERR! Expected: 8f90341e68a53ccc928788dacfcd11b36eb9b78e
npm ERR! Actual:   86650610e950f4422d99009473f9dbd265817577
npm ERR! From:     https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.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!     /home/gordon/git/Visualization/npm-debug.log

GordonSmith avatar May 12 '16 09:05 GordonSmith

I suspect this is caused by: https://github.com/Microsoft/BashOnWindows/issues/313

GordonSmith avatar May 12 '16 12:05 GordonSmith

related https://github.com/npm/npm/issues/12436

ballPointPenguin avatar May 12 '16 16:05 ballPointPenguin

I have same issue (Win10 build 14342) using node 4.x, 5x. and 6.x from nodesource repo. I am able to install npm modules when I stick to the ubuntu trusty repo packages, (nodejs v0.10.25 & npm v1.3.10) but I can't seem to run anything, instead I just get this:

/usr/bin/env: node: No such file or directory

ballPointPenguin avatar May 12 '16 16:05 ballPointPenguin

@GordonSmith I believe you are right. The fix for that issue should hopefully be in the next insider fast ring build.

benhillis avatar May 12 '16 18:05 benhillis

Is there any temporary workaround?

wycats avatar May 13 '16 18:05 wycats

@wycats No it is an issue in lxcore.sys so you'll need an updated version of the driver.

benhillis avatar May 13 '16 18:05 benhillis

@ballPointPenguin for later versions the node package name was renamed to nodejs so you have to add a symlink for "node" to work:

sudo ln -s which nodejs /usr/bin/node

SO: nodejs vs node on ubuntu 12.04

That said I don't think is related to the checksum fails

Aigeec avatar May 17 '16 23:05 Aigeec

Thanks @Aigeec that helps. I'm still stuck on v0.10.25 until this issue resolves.

ballPointPenguin avatar May 18 '16 18:05 ballPointPenguin

Similar error for installing webpack, looking forward to the next insider preview.

komali2 avatar May 18 '16 22:05 komali2

Hard way but not efficient :)

$ curl -O `npm show bower dist.tarball` 
$ npm install bower-x.x.x.tgz       # SUCCESS
$ curl -O `npm show grunt-cli dist.tarball` 
$ npm install grunt-cli-x.x.x.tgz    # SUCCESS. If it fails just retry npm install tarball again.
$ npm ls
/home/me
├── [email protected]
└─┬ [email protected]
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   ├─┬ [email protected]
  │   │ └── [email protected]
  │   ├── [email protected]
  │   ├─┬ [email protected]
  │   │ └─┬ [email protected]
  │   │   ├── [email protected]
  │   │   └── [email protected]
  │   ├── [email protected]
  │   └── [email protected]
  ├── [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └── [email protected]

Works on my build 14342. Please try download tarball file on your windows side, not on bash, if you get broken files even if npm install successed. Overwrite it over package under node_moduels or just extract it and go.

$ tar xvzf /mnt/c/Users/me/Downloads/bower-*-*-*.tgz
$ ./package/bin/bower

Usage:

    bower <command> [<args>] [<options>]
Commands:

    cache                   Manage bower cache
    help                    Display help information about Bower
    home                    Opens a package homepage into your favorite browser
    info                    Info of a particular package
    init                    Interactively create a bower.json file
...
$ # npm ln works too
$ cd package
$ sudo npm ln
$ bower --version
1.7.9

lateau avatar May 20 '16 15:05 lateau

I installed nodejs & npm through this way http://askubuntu.com/a/635469 Still getting a sha1 checksum error when trying to install keystone

~$ sudo npm install -g generator-keystone
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "generator-keystone"
npm ERR! node v5.11.1
npm ERR! npm  v3.8.6

npm ERR! shasum check failed for /tmp/npm-35-00d28d35/registry.npmjs.org/hoek/-/hoek-2.16.3.tgz
npm ERR! Expected: 20bb7403d3cea398e91dc4710a8ff1b8274a25ed
npm ERR! Actual:   8756f794adec4fee08aedda4558f61816f121db3
npm ERR! From:     https://registry.npmjs.org/hoek/-/hoek-2.16.3.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!     /home/mitul/npm-debug.log

mit2u avatar May 21 '16 04:05 mit2u

Latest build doesn't seem to have fixed the issue?

wycats avatar May 22 '16 07:05 wycats

I've verified this is fixed in build 14352, please reopen if you continue to see this issue. Thanks!

benhillis avatar May 27 '16 18:05 benhillis

I'm having this issue on build 14393.1358. Doesn't seem to be fixed. 😕

nighto avatar Jun 23 '17 03:06 nighto

having this issue, i went to my windows file and try to install npm install and its saying: Syntax error: word unexpected (expecting "in").

ajSTACKS avatar Oct 24 '17 19:10 ajSTACKS