0

我无法使用节点 js 安装任何软件包。最终完全无法使用。尝试运行“npm install socket”时获取以下日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\NODEJS\\\\node.exe',
1 verbose cli   'C:\\NODEJS\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'socket' ]
2 info using npm@1.3.10
3 info using node@v0.10.18
4 verbose node symlink C:\NODEJS\\node.exe
5 verbose cache add [ 'socket', null ]
6 verbose cache add name=undefined spec="socket" args=["socket",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',
7 verbose parsed url   path: 'socket',
7 verbose parsed url   href: 'socket' }
8 silly lockFile 897d2105-socket socket
9 verbose lock socket C:\Users\cbaid\AppData\Roaming\npm-cache\897d2105-socket.lock
10 silly lockFile 897d2105-socket socket
11 silly lockFile 897d2105-socket socket
12 verbose addNamed [ 'socket', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile 45707214-socket socket@
15 verbose lock socket@ C:\Users\cbaid\AppData\Roaming\npm-cache\45707214-socket.lock
16 silly addNameRange { name: 'socket', range: '*', hasData: false }
17 verbose url raw socket
18 verbose url resolving [ 'https://registry.npmjs.org/', './socket' ]
19 verbose url resolved https://registry.npmjs.org/socket
20 info trying registry request attempt 1 at 13:37:24
21 verbose etag "ECC2J4RYC4C159M60TQITIXSD"
22 http GET https://registry.npmjs.org/socket
23 http 304 https://registry.npmjs.org/socket
24 silly registry.get cb [ 304,
24 silly registry.get   { server: 'CouchDB/1.3.1 (Erlang OTP/R15B03)',
24 silly registry.get     etag: '"ECC2J4RYC4C159M60TQITIXSD"',
24 silly registry.get     date: 'Fri, 06 Sep 2013 08:07:26 GMT',
24 silly registry.get     'content-length': '0' } ]
25 verbose etag socket from cache
26 silly addNameRange number 2 { name: 'socket', range: '*', hasData: true }
27 silly addNameRange versions [ 'socket', [ '0.0.1' ] ]
28 verbose addNamed [ 'socket', '0.0.1' ]
29 verbose addNamed [ '0.0.1', '0.0.1' ]
30 silly lockFile ccbb8590-socket-0-0-1 socket@0.0.1
31 verbose lock socket@0.0.1 C:\Users\cbaid\AppData\Roaming\npm-cache\ccbb8590-socket-0-0-1.lock
32 silly lockFile ccbb8590-socket-0-0-1 socket@0.0.1
33 silly lockFile ccbb8590-socket-0-0-1 socket@0.0.1
34 silly lockFile 45707214-socket socket@
35 silly lockFile 45707214-socket socket@
36 silly resolved [ { name: 'socket',
36 silly resolved     description: 'Socket is a connect clone for simple socket based applications',
36 silly resolved     version: '0.0.1',
36 silly resolved     author:
36 silly resolved      { name: 'Richard S Allinson',
36 silly resolved        email: 'rsa@mounitainmansoftware.com' },
36 silly resolved     main: 'index',
36 silly resolved     engines: { node: '>= 0.6.0 < 0.7.0' },
36 silly resolved     dependencies: { microtime: '=0.2.0' },
36 silly resolved     repository: { type: 'git', url: 'https://github.com/capecodehq/socket.git' },
36 silly resolved     license: 'MIT',
36 silly resolved     bugs: { url: 'https://github.com/capecodehq/socket/issues' },
36 silly resolved     readme: 'ERROR: No README data found!',
36 silly resolved     _id: 'socket@0.0.1',
36 silly resolved     _from: 'socket@' } ]
37 info install socket@0.0.1 into C:\NODEJS
38 info installOne socket@0.0.1
39 warn engine socket@0.0.1: wanted: {"node":">= 0.6.0 < 0.7.0"} (current: {"node":"v0.10.18","npm":"1.3.10"})
40 info C:\NODEJS\node_modules\socket unbuild
41 verbose tar unpack C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
42 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
43 verbose lock tar://C:\NODEJS\node_modules\socket C:\Users\cbaid\AppData\Roaming\npm-cache\aac0ba32-tar-C-NODEJS-node-modules-socket.lock
44 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
45 verbose lock tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz C:\Users\cbaid\AppData\Roaming\npm-cache\31f734a2-m-cache-socket-0-0-1-package-tgz.lock
46 silly gunzTarPerm modes [ '755', '644' ]
47 silly gunzTarPerm extractEntry package.json
48 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
49 silly gunzTarPerm extractEntry index.js
50 silly gunzTarPerm modified mode [ 'index.js', 438, 420 ]
51 silly gunzTarPerm extractEntry examples/echo-server.js
52 silly gunzTarPerm modified mode [ 'examples/echo-server.js', 438, 420 ]
53 silly gunzTarPerm extractEntry examples/simple-test.js
54 silly gunzTarPerm modified mode [ 'examples/simple-test.js', 438, 420 ]
55 silly gunzTarPerm extractEntry examples/simple-time-server.js
56 silly gunzTarPerm modified mode [ 'examples/simple-time-server.js', 438, 420 ]
57 silly gunzTarPerm extractEntry lib/index.js
58 silly gunzTarPerm modified mode [ 'lib/index.js', 438, 420 ]
59 silly gunzTarPerm extractEntry lib/proto.js
60 silly gunzTarPerm modified mode [ 'lib/proto.js', 438, 420 ]
61 silly gunzTarPerm extractEntry lib/utils.js
62 silly gunzTarPerm modified mode [ 'lib/utils.js', 438, 420 ]
63 silly gunzTarPerm extractEntry lib/middleware/echo.js
64 silly gunzTarPerm modified mode [ 'lib/middleware/echo.js', 438, 420 ]
65 silly gunzTarPerm extractEntry lib/middleware/errorHandler.js
66 silly gunzTarPerm modified mode [ 'lib/middleware/errorHandler.js', 438, 420 ]
67 silly gunzTarPerm extractEntry lib/middleware/json.js
68 silly gunzTarPerm modified mode [ 'lib/middleware/json.js', 438, 420 ]
69 silly gunzTarPerm extractEntry lib/middleware/profiler.js
70 silly gunzTarPerm modified mode [ 'lib/middleware/profiler.js', 438, 420 ]
71 silly gunzTarPerm extractEntry nbproject/private/private.properties
72 silly gunzTarPerm modified mode [ 'nbproject/private/private.properties', 438, 420 ]
73 silly gunzTarPerm extractEntry nbproject/project.properties
74 silly gunzTarPerm modified mode [ 'nbproject/project.properties', 438, 420 ]
75 silly gunzTarPerm extractEntry nbproject/project.xml
76 silly gunzTarPerm modified mode [ 'nbproject/project.xml', 438, 420 ]
77 silly gunzTarPerm extractEntry scripts/lint
78 silly gunzTarPerm modified mode [ 'scripts/lint', 438, 420 ]
79 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
80 silly lockFile aac0ba32-tar-C-NODEJS-node-modules-socket tar://C:\NODEJS\node_modules\socket
81 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
82 silly lockFile 31f734a2-m-cache-socket-0-0-1-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\socket\0.0.1\package.tgz
83 info preinstall socket@0.0.1
84 verbose readDependencies using package.json deps
85 verbose readDependencies using package.json deps
86 verbose cache add [ 'microtime@=0.2.0', null ]
87 verbose cache add name=undefined spec="microtime@=0.2.0" args=["microtime@=0.2.0",null]
88 verbose parsed url { protocol: null,
88 verbose parsed url   slashes: null,
88 verbose parsed url   auth: null,
88 verbose parsed url   host: null,
88 verbose parsed url   port: null,
88 verbose parsed url   hostname: null,
88 verbose parsed url   hash: null,
88 verbose parsed url   search: null,
88 verbose parsed url   query: null,
88 verbose parsed url   pathname: 'microtime@=0.2.0',
88 verbose parsed url   path: 'microtime@=0.2.0',
88 verbose parsed url   href: 'microtime@=0.2.0' }
89 verbose cache add name="microtime" spec="=0.2.0" args=["microtime","=0.2.0"]
90 verbose parsed url { protocol: null,
90 verbose parsed url   slashes: null,
90 verbose parsed url   auth: null,
90 verbose parsed url   host: null,
90 verbose parsed url   port: null,
90 verbose parsed url   hostname: null,
90 verbose parsed url   hash: null,
90 verbose parsed url   search: null,
90 verbose parsed url   query: null,
90 verbose parsed url   pathname: '=0.2.0',
90 verbose parsed url   path: '=0.2.0',
90 verbose parsed url   href: '=0.2.0' }
91 verbose addNamed [ 'microtime', '=0.2.0' ]
92 verbose addNamed [ null, '=0.2.0' ]
93 silly lockFile 2e0a3709-microtime-0-2-0 microtime@=0.2.0
94 verbose lock microtime@=0.2.0 C:\Users\cbaid\AppData\Roaming\npm-cache\2e0a3709-microtime-0-2-0.lock
95 verbose url raw microtime/0.2.0
96 verbose url resolving [ 'https://registry.npmjs.org/', './microtime/0.2.0' ]
97 verbose url resolved https://registry.npmjs.org/microtime/0.2.0
98 info trying registry request attempt 1 at 13:37:26
99 verbose etag "83RCGGZ6LJDDFS0SFLQ3JN44H"
100 http GET https://registry.npmjs.org/microtime/0.2.0
101 http 304 https://registry.npmjs.org/microtime/0.2.0
102 silly registry.get cb [ 304,
102 silly registry.get   { server: 'CouchDB/1.3.1 (Erlang OTP/R15B03)',
102 silly registry.get     etag: '"83RCGGZ6LJDDFS0SFLQ3JN44H"',
102 silly registry.get     date: 'Fri, 06 Sep 2013 08:07:28 GMT',
102 silly registry.get     'content-length': '0' } ]
103 verbose etag microtime/0.2.0 from cache
104 silly lockFile 2e0a3709-microtime-0-2-0 microtime@=0.2.0
105 silly lockFile 2e0a3709-microtime-0-2-0 microtime@=0.2.0
106 silly resolved [ { name: 'microtime',
106 silly resolved     version: '0.2.0',
106 silly resolved     description: 'Get the current time in microseconds',
106 silly resolved     author:
106 silly resolved      { name: 'Wade Simmons',
106 silly resolved        email: 'wade@wades.im',
106 silly resolved        url: 'http://wades.im/mons' },
106 silly resolved     homepage: 'https://github.com/wadey/node-microtime',
106 silly resolved     repository:
106 silly resolved      { type: 'git',
106 silly resolved        url: 'git://github.com/wadey/node-microtime.git' },
106 silly resolved     main: './index',
106 silly resolved     engines: { node: '>= 0.2.0' },
106 silly resolved     scripts: { install: 'node-waf configure build', test: 'node test.js' },
106 silly resolved     readme: '# node-microtime\n\nDate.now() will only give you accuracy in milliseconds. This module calls\n`gettimeofday(2)` to get the time in microseconds and provides it in a few\ndifferent formats. The same warning from that function applies:\n_The resolution of the system clock is hardware dependent, and the time may\nbe updated continuously or in ``ticks.\'\'_\n\n# Installation\n\n    npm install microtime\n\n# Usage\n\n### microtime.now()\n\nGet the current time in microseconds as an integer. Since JavaScript can only\nrepresent integer values accurately up to `Math.pow(2, 53)`, this value will\nbe accurate up to _Tue, 05 Jun 2255 23:47:34 GMT_.\n\n### microtime.nowDouble()\n\nGet the current time in seconds as a floating point number with microsecond\naccuracy (similar to `time.time()` in Python and `Time.now.to_f` in Ruby).\n\n### microtime.nowStruct()\n\nGet the current time and return as a list with seconds and microseconds (matching the return value of `gettimeofday(2)`).\n\n# Example\n\n    > var microtime = require(\'microtime\')\n    > microtime.now()\n    1297448895297028\n    > microtime.nowDouble()\n    1297448897.600976\n    > microtime.nowStruct()\n    [ 1297448902, 753875 ]\n\n## Estimating clock resolution\n\nStarting with version 0.1.3, there is a test script that tries to guess the clock resolution. You can run it with `npm test microtime`. Example output:\n\n    microtime.now() = 1298960083489806\n    microtime.nowDouble() = 1298960083.511521\n    microtime.nowStruct() = [ 1298960083, 511587 ]\n\n    Guessing clock resolution...\n    Clock resolution observed: 1us\n\n## Tested on\n\n    Node.js 0.2.6\n      - OS X 10.6.6\n      - Ubuntu 10.04\n\n    Node.js 0.4.1\n      - OS X 10.6.6\n      - Windows 7 64bit (Cygwin) *\n\n## Warning for Cygwin users\n\nIt appears that Cygwin only implements `gettimeofday(2)` with [millisecond accuracy](http://old.nabble.com/gettimeofday---millisecond-accuracy-p21085475.html).\n',
106 silly resolved     readmeFilename: 'README.md',
106 silly resolved     bugs: { url: 'https://github.com/wadey/node-microtime/issues' },
106 silly resolved     _id: 'microtime@0.2.0',
106 silly resolved     _from: 'microtime@=0.2.0' } ]
107 info install microtime@0.2.0 into C:\NODEJS\node_modules\socket
108 info installOne microtime@0.2.0
109 info C:\NODEJS\node_modules\socket\node_modules\microtime unbuild
110 verbose tar unpack C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
111 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
112 verbose lock tar://C:\NODEJS\node_modules\socket\node_modules\microtime C:\Users\cbaid\AppData\Roaming\npm-cache\4c47d62b-es-socket-node-modules-microtime.lock
113 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
114 verbose lock tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz C:\Users\cbaid\AppData\Roaming\npm-cache\51b2e7ce-ache-microtime-0-2-0-package-tgz.lock
115 silly gunzTarPerm modes [ '755', '644' ]
116 silly gunzTarPerm extractEntry package.json
117 silly gunzTarPerm modified mode [ 'package.json', 438, 420 ]
118 silly gunzTarPerm extractEntry README.md
119 silly gunzTarPerm modified mode [ 'README.md', 438, 420 ]
120 silly gunzTarPerm extractEntry LICENSE
121 silly gunzTarPerm modified mode [ 'LICENSE', 438, 420 ]
122 silly gunzTarPerm extractEntry index.js
123 silly gunzTarPerm modified mode [ 'index.js', 438, 420 ]
124 silly gunzTarPerm extractEntry test.js
125 silly gunzTarPerm modified mode [ 'test.js', 438, 420 ]
126 silly gunzTarPerm extractEntry src/microtime.cc
127 silly gunzTarPerm modified mode [ 'src/microtime.cc', 438, 420 ]
128 silly gunzTarPerm extractEntry wscript
129 silly gunzTarPerm modified mode [ 'wscript', 438, 420 ]
130 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
131 silly lockFile 4c47d62b-es-socket-node-modules-microtime tar://C:\NODEJS\node_modules\socket\node_modules\microtime
132 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
133 silly lockFile 51b2e7ce-ache-microtime-0-2-0-package-tgz tar://C:\Users\cbaid\AppData\Roaming\npm-cache\microtime\0.2.0\package.tgz
134 info preinstall microtime@0.2.0
135 verbose readDependencies using package.json deps
136 verbose readDependencies using package.json deps
137 silly resolved []
138 verbose about to build C:\NODEJS\node_modules\socket\node_modules\microtime
139 info build C:\NODEJS\node_modules\socket\node_modules\microtime
140 verbose linkStuff [ false,
140 verbose linkStuff   false,
140 verbose linkStuff   false,
140 verbose linkStuff   'C:\\NODEJS\\node_modules\\socket\\node_modules' ]
141 info linkStuff microtime@0.2.0
142 verbose linkBins microtime@0.2.0
143 verbose linkMans microtime@0.2.0
144 verbose rebuildBundles microtime@0.2.0
145 info install microtime@0.2.0
146 verbose unsafe-perm in lifecycle true
147 error Error: spawn ENOENT
147 error     at errnoException (child_process.js:980:11)
147 error     at Process.ChildProcess._handle.onexit (child_process.js:771:34)
148 error If you need help, you may report this log at:
148 error     <http://github.com/isaacs/npm/issues>
148 error or email it to:
148 error     <npm-@googlegroups.com>
149 error System Windows_NT 6.1.7601
150 error command "C:\\NODEJS\\\\node.exe" "C:\\NODEJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket"
151 error cwd C:\NODEJS
152 error node -v v0.10.18
153 error npm -v 1.3.10
154 error syscall spawn
155 error code ENOENT
156 error errno ENOENT
157 verbose exit [ 1, true ]

我已经多次卸载并安装了nodejs。甚至通过尝试不同帖子上人们提到的不同方法来尝试几种方法。但到目前为止没有任何效果。有人可以帮忙吗?

4

1 回答 1

2

我看到这个问题被标记为 socket.io - 看起来你忘记了“socket.io”的“.io”部分。尝试这个:

npm install socket.io

至于解释你看到的错误,socket 包是一个相当老的包,package.json 说它只支持节点 v0.6 到 v0.7:

engines: { node: '>= 0.6.0 < 0.7.0' }

根本问题是套接字使用了在节点 v0.8 中删除的 node-waf(node- gyp是替代品)。

于 2013-09-06T10:52:17.333 回答