Socket.io installation fails on windows 7 32 bit
Asked Answered
P

6

10

I installed node.js v0.8.22 and tried to install socket.io in Windows 7 32bit Socket.io installation fails consecutively. Console log is:

C:\Program Files\nodejs>npm install socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io
npm http 200 https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/socket.io/-/socket.io-0.9.13.tgz
npm http 200 https://registry.npmjs.org/socket.io/-/socket.io-0.9.13.tgz
npm ERR! Error: EPERM, mkdir 'C:\Program Files\nodejs\node_modules\socket.io'
npm ERR!  { [Error: EPERM, mkdir 'C:\Program Files\nodejs\node_modules\socket.io
']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\socket.io',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: 'C:\\Program Files\\nodejs\\node_modules\\socket.io',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack:
npm ERR!    [ 'DirWriter._create (C:\\Program Files\\nodejs\\node_modules\\npm\\
node_modules\\fstream\\lib\\dir-writer.js:36:23)',
npm ERR!      'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\mkdir
p\\index.js:37:53',
npm ERR!      'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Program Files\nodejs
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path C:\Program Files\nodejs\node_modules\socket.io
npm ERR! fstream_path C:\Program Files\nodejs\node_modules\socket.io
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, mkdir 'C:\Program Files\nodejs\node_modules\socket.
io'
npm ERR! fstream_stack DirWriter._create (C:\Program Files\nodejs\node_modules\n
pm\node_modules\fstream\lib\dir-writer.js:36:23)
npm ERR! fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\mkd
irp\index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR! Error: EPERM, open 'C:\Program Files\nodejs\npm-debug.log'
npm ERR!  { [Error: EPERM, open 'C:\Program Files\nodejs\npm-debug.log']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: 'C:\\Program Files\\nodejs\\npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Program Files\nodejs
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path C:\Program Files\nodejs\npm-debug.log
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, open 'C:\Program Files\nodejs\npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Program Files\nodejs\npm-debug.log
npm ERR! not ok code 0

Is there any workaround? How can I install Socket.io on windows 7 32 bit?

Philipps answered 7/3, 2013 at 13:32 Comment(0)
F
12

Looks like you need to run it with admin privileges, try running the CMD with Administrator (Run as Administrator) and then npm install socket.io

Frawley answered 7/3, 2013 at 13:35 Comment(0)
L
13

I'll share what worked for me on windows when trying to run npm install and got the "npm ERR! Error: EPERM, mkdir"...

I have to manually give permission to write to the folder...

In your case, you would need to go to

C:\Program Files\nodejs\node_modules\

Usin your windows explorer, right click, choose 'Properties' and go to 'Security' tab

You will see many users... just give privileges to the user you need and try running npm install again again...

Lewert answered 9/5, 2014 at 16:17 Comment(1)
In my case I had to give permissions to C:\Program Files\nodejsDanieu
F
12

Looks like you need to run it with admin privileges, try running the CMD with Administrator (Run as Administrator) and then npm install socket.io

Frawley answered 7/3, 2013 at 13:35 Comment(0)
I
2

Instead of vanilla command prompt, I used windows powershell (on win7) and above error was gone.

Intramolecular answered 10/3, 2015 at 7:6 Comment(1)
THANK YOU Sir!!! I have tried millions of things and none of them worked. Using Powershell instead of cmd solved the problem.Primine
S
1

Thanks, for the pointers @Griiettner. If you are running/executing via gitbash then give administrator rights to "C:\Program Files (x86)\Git" folder.

Same as above, Using your windows explorer, right click, choose 'Properties' and go to 'Security' tab.

This occurred/struck me hard when I used "npm config set prefix" command to change the config (following this blog http://blog.webbb.be/command-not-found-node-npm/), but I have put back to old loc. using "npm config set prefix C:/Users/[Username]/AppData/Roaming/npm".

Stalag answered 4/11, 2014 at 9:22 Comment(0)
S
0

I thought I'd share a solution that wasn't yet posted: make sure your node application isn't already running. I had this issue while trying to remove a dependency (npm uninstall mongoose --save) while my Node app was running, which obviously did not work.

Spoon answered 10/12, 2014 at 16:18 Comment(0)
T
0

On my case i have same problem with Babel, resolved by install him globally

Tufthunter answered 2/3, 2016 at 5:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.