我是我现在所做的新事物(Node.js,socket.io)。
我已经安装了Node.js,现在我正在尝试安装socket.io但是我遇到了这个EACCESS错误。谢谢你的帮助!
我正在使用Windows 7 x64
我以特权运行cmd
然后
npm install socket.io
这是日志:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'socket.io' ]
2 info using npm@1.3.14
3 info using node@v0.10.22
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose cache add [ 'socket.io', null ]
6 verbose cache add name=undefined spec="socket.io" args=["socket.io",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'socket.io',
7 verbose parsed url path: 'socket.io',
7 verbose parsed url href: 'socket.io' }
8 silly lockFile 71475bfd-socket-io socket.io
9 verbose lock socket.io C:\Users\Bobby\AppData\Roaming\npm-cache\71475bfd-socket- io.lock
10 silly lockFile 71475bfd-socket-io socket.io
11 silly lockFile 71475bfd-socket-io socket.io
12 verbose addNamed [ 'socket.io', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile c03de861-socket-io socket.io@
15 verbose lock socket.io@ C:\Users\Bobby\AppData\Roaming\npm-cache\c03de861-socket- io.lock
16 silly addNameRange { name: 'socket.io', range: '*', hasData: false }
17 verbose url raw socket.io
18 verbose url resolving [ 'https://registry.npmjs.org/', './socket.io' ]
19 verbose url resolved https://registry.npmjs.org/socket.io
20 info trying registry request attempt 1 at 09:33:49
21 http GET https://registry.npmjs.org/socket.io
22 info retry will retry, error on last attempt: Error: connect EACCES
23 info trying registry request attempt 2 at 09:34:00
24 http GET https://registry.npmjs.org/socket.io
25 info retry will retry, error on last attempt: Error: connect EACCES
26 info trying registry request attempt 3 at 09:35:00
27 http GET https://registry.npmjs.org/socket.io
28 silly lockFile c03de861-socket-io socket.io@
29 silly lockFile c03de861-socket-io socket.io@
30 error Error: connect EACCES
30 error at errnoException (net.js:901:11)
30 error at Object.afterConnect [as oncomplete] (net.js:892:19)
30 error { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'connect' }
31 error Please try running this command again as root/Administrator.
32 error System Windows_NT 6.1.7601
33 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
34 error cwd C:\node
35 error node -v v0.10.22
36 error npm -v 1.3.14
37 error syscall connect
38 error code EACCES
39 error errno EACCES
40 error stack Error: connect EACCES
40 error stack at errnoException (net.js:901:11)
40 error stack at Object.afterConnect [as oncomplete] (net.js:892:19)
41 verbose exit [ 1, true ]
答案 0 :(得分:1)
EACCES表示socket.io无法访问端口。可能是因为您没有权限,或者该端口已被其他应用程序使用。您应该以管理员身份运行此命令和/或使用port.io尝试访问的端口关闭任何进程。
我认为是:
runas /noprofile /root:Administrator npm install socket.io