我安装了node.js v0.8.22并尝试在Windows 7 32bit Socket.io安装socket.io连续失败。控制台日志是:
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
有什么解决方法吗?如何在 Windows 7 32 位上安装 Socket.io?