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?
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...
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
Instead of vanilla command prompt, I used windows powershell (on win7) and above error was gone.
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