Why do I get this error when trying to install socket.io. I am using latest version of NodeJS and have set path variable. I am using Windows 7 with admin rights in cmd.
> ws@0.4.25 install C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io
-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CreateProcessW: The system cannot find the file specified.
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Dusan\node_modules
\socket.io\node_modules\socket.io-client\node_modules\active-x-obfuscator\node_m
odules\zeparser'
npm ERR! error rolling back socket.io-client@0.9.11 { [Error: ENOTEMPTY, rmdir
'C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io-client\node_module
s\active-x-obfuscator\node_modules\zeparser']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\\Users\\Dusan\\node_modules\\socket.io\\
node_modules\\socket.io-client\\node_modules\\active-x-obfuscator\\node_modules\
\zeparser' }
npm ERR! error rolling back Error: EPERM, rmdir 'C:\Users\Dusan\node_modules\soc
ket.io\node_modules\socket.io-client\node_modules\active-x-obfuscator\node_modul
es\zeparser\benchmark.html'
npm ERR! error rolling back socket.io@0.9.13 { [Error: EPERM, rmdir 'C:\Users\D
usan\node_modules\socket.io\node_modules\socket.io-client\node_modules\active-x-
obfuscator\node_modules\zeparser\benchmark.html']
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'C:\\Users\\Dusan\\node_modules\\socket.io\\
node_modules\\socket.io-client\\node_modules\\active-x-obfuscator\\node_modules\
\zeparser\\benchmark.html' }
npm ERR! ws@0.4.25 install: `(node-gyp rebuild 2> builderror.log) || (exit 0)`
npm ERR! `cmd "/c" "(node-gyp rebuild 2> builderror.log) || (exit 0)"` failed wi
th 127
npm ERR!
npm ERR! Failed at the ws@0.4.25 install script.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! You can get their info via:
npm ERR! npm owner ls ws
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Users\Dusan
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat 'C:\Users\Dusan\node_modules\socket.io\node_module
s\socket.io-client\node_modules\active-x-obfuscator\node_modules\zeparser\benchm
ark.html'
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.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Users\Dusan
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io-clien
t\node_modules\active-x-obfuscator\node_modules\zeparser\benchmark.html
npm ERR! fstream_path C:\Users\Dusan\node_modules\socket.io\node_modules\socket.
io-client\node_modules\active-x-obfuscator\node_modules\zeparser\benchmark.html
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modul
es\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Dusan\npm-debug.log
npm ERR! not ok code 0
I don't know other way of posting this question. Please edit this.
Try to add c:\windows\system32
to your PATH
. Since you are using cmd as Administrator the directories will be different.
See the socket.io issue, reported here. Another similar issue on Windows on SO.
To all who struggles with this on a VM with shared folder. I had no luck following none of these advices, but some time later I tried installing this to another location that is not a shared folder and everything worked flawlessly. Or you can try installing it from the master machine that hosts a VM to that folder. Hope this will help someone.
I had a similar problem on Mac. What resolved my problem is installing a slightly older version of Socket.io.
I did:
npm install socket.io@"~0.8.1"
which would install the latest version between 0.8.0 to 0.8.9, but not 0.9.0 or above.
Socket.io then installed perfectly.
I also installed
sudo npm install -g node-gyp
but by itself it didn't resolve the problem.
To use the latest version of socket.io ... first 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.
Examples:
GYP_MSVS_VERSION=2012
for Visual Studio 2012 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 Python and Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.
Feel free to add your vote at:
I did not need to install node-gyp, but it seems like you do. Run this first,
$ npm install -g node-gyp
And try again. If it fails, reboot your computer once for PATH propagation.