0

I am using node js-version:0.10.7 npm version:1.2.14 When I tried to install socket.io,

npm install socket.io

I get the following error

C:\Users\Documents\tools\nodejs\nodejs\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws>node "C:\Users\Documents\tools\nodejs\nodejs\nod
\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm http 200 http://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz
npm ERR! Error: shasum check failed for C:\Users\AppData\Local\Temp\npm-7080\1387359252710-0.8488596209790558\tmp.tgz
npm ERR! Expected: 03726561bc268f2e5444f54c665b7fd4a8c029e2
npm ERR! Actual:   1f0d4d7696afb3dc9275c565270dea1b173bc0d4
npm ERR!     at C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\lib\utils\sha.js:29:20
npm ERR!     at ReadStream.<anonymous> (C:\Users\Documents\tools\nodejs\nodejs\node_modules\npm\lib\utils\sha.js:49:5)
npm ERR!     at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:910:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\\Documents\\tools\\nodejs\\nodejs\\\\node.exe" "C:\\Users\\\Documents\\tools\\nodejs\\nodejs\\node_modules\\npm\\bin\\npm-cli.j
"socket.io"
npm ERR! cwd C:\Users\Documents\tools\nodejs\nodejs
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.14
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Documents\tools\nodejs\nodejs\npm-debug.log
npm ERR! not ok code 0

What may be the reason? Please Advice

user67867
  • 421
  • 4
  • 11
  • 24

2 Answers2

0

As you can see the shasum check fails, try deleting the C:\Users\AppData\Local\Temp\npm-* directories. After that you can try again.

If this does not work make sure you have node-gyp installed, with all the dependencies. Sound similar problem to this: NPM - Can't install socket.IO.

Community
  • 1
  • 1
Risto Novik
  • 8,199
  • 9
  • 50
  • 66
0

Make sure you have all the required software to run node-gyp:

You can configure version of Visual Studio used by gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property every time you do an npm install.

Examples:

  • set GYP_MSVS_VERSION=2012 for Visual Studio 2012
  • set GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition')

For the full list see - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets that socket.io depends on as part of CORE node and also to ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.

Feel free to add your vote at:

Tony O'Hagan
  • 21,638
  • 3
  • 67
  • 78