npm install websocket-server 安装出错
发布于 9 年前 作者 cnyunguo 4814 次浏览 最后一次编辑是 8 年前 来自 问答

QQ截图20150529072725.png

以上是错误信息和环境版本信息,系统版本是 ubuntu 14.04 64位

6 回复

npm 里面压根没有这个库,无米之炊啊!!!

0 info it worked if it ends with ok 1 verbose cli [ ‘/usr/local/bin/node’, 1 verbose cli ‘/usr/local/bin/npm’, 1 verbose cli ‘install’, 1 verbose cli ‘websocket-server’ ] 2 info using npm@2.10.1 3 info using node@v0.12.4 4 verbose config Skipping project config: /root/.npmrc. (matches userconfig) 5 verbose install initial load of /root/package.json 6 verbose installManyTop reading scoped package data from /root/node_modules/node-websocket-server/package.json 7 verbose installManyTop reading scoped package data from /root/node_modules/socket-server/package.json 8 info package.json socket-server@0.0.4 No license field. 9 verbose readDependencies loading dependencies from /root/package.json 10 silly cache add args [ ‘websocket-server’, null ] 11 verbose cache add spec websocket-server 12 silly cache add parsed spec { raw: ‘websocket-server’, 12 silly cache add scope: null, 12 silly cache add name: ‘websocket-server’, 12 silly cache add rawSpec: ‘’, 12 silly cache add spec: ‘’, 12 silly cache add type: ‘range’ } 13 silly addNamed websocket-server@ 14 verbose addNamed "" is a valid semver range for websocket-server 15 silly addNameRange { name: ‘websocket-server’, range: '’, hasData: false } 16 silly mapToRegistry name websocket-server 17 silly mapToRegistry using default registry 18 silly mapToRegistry registry https://registry.npmjs.org/ 19 silly mapToRegistry uri https://registry.npmjs.org/websocket-server 20 verbose addNameRange registry:https://registry.npmjs.org/websocket-server not in flight; fetching 21 verbose request uri https://registry.npmjs.org/websocket-server 22 verbose request no auth needed 23 info attempt registry request try #1 at 08:05:51 24 verbose request id 72161651f9fd3cb5 25 http request GET https://registry.npmjs.org/websocket-server 26 http 404 https://registry.npmjs.org/websocket-server 27 verbose headers { server: ‘CouchDB/1.5.0 (Erlang OTP/R16B03)’, 27 verbose headers etag: ‘“F381D8VP24EBC298S1SXDCCP9”’, 27 verbose headers ‘content-type’: ‘application/json’, 27 verbose headers ‘cache-control’: ‘max-age=0’, 27 verbose headers ‘content-length’: ‘1689’, 27 verbose headers ‘accept-ranges’: ‘bytes’, 27 verbose headers date: ‘Fri, 29 May 2015 00:05:51 GMT’, 27 verbose headers via: ‘1.1 varnish’, 27 verbose headers connection: ‘keep-alive’, 27 verbose headers ‘x-served-by’: ‘cache-sjc3128-SJC’, 27 verbose headers ‘x-cache’: ‘MISS’, 27 verbose headers ‘x-cache-hits’: ‘0’, 27 verbose headers ‘x-timer’: ‘S1432857951.874309,VS0,VE91’, 27 verbose headers vary: ‘Accept’ } 28 silly get cb [ 404, 28 silly get { server: ‘CouchDB/1.5.0 (Erlang OTP/R16B03)’, 28 silly get etag: ‘“F381D8VP24EBC298S1SXDCCP9”’, 28 silly get ‘content-type’: ‘application/json’, 28 silly get ‘cache-control’: ‘max-age=0’, 28 silly get ‘content-length’: ‘1689’, 28 silly get ‘accept-ranges’: ‘bytes’, 28 silly get date: ‘Fri, 29 May 2015 00:05:51 GMT’, 28 silly get via: ‘1.1 varnish’, 28 silly get connection: ‘keep-alive’, 28 silly get ‘x-served-by’: ‘cache-sjc3128-SJC’, 28 silly get ‘x-cache’: ‘MISS’, 28 silly get ‘x-cache-hits’: ‘0’, 28 silly get ‘x-timer’: ‘S1432857951.874309,VS0,VE91’, 28 silly get vary: ‘Accept’ } ] 29 verbose stack Error: Registry returned 404 for GET on https://registry.npmjs.org/websocket-server 29 verbose stack at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:239:14) 29 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14) 29 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:368:22) 29 verbose stack at Request.emit (events.js:110:17) 29 verbose stack at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1219:14) 29 verbose stack at Request.emit (events.js:129:20) 29 verbose stack at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1167:12) 29 verbose stack at IncomingMessage.emit (events.js:129:20) 29 verbose stack at _stream_readable.js:908:16 29 verbose stack at process._tickCallback (node.js:355:11) 30 verbose statusCode 404 31 verbose pkgid websocket-server 32 verbose cwd /root/chat 33 error Linux 3.13.0-32-generic 34 error argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” "websocket-server" 35 error node v0.12.4 36 error npm v2.10.1 37 error code E404 38 error 404 Registry returned 404 for GET on https://registry.npmjs.org/websocket-server 38 error 404 38 error 404 ‘websocket-server’ is not in the npm registry. 38 error 404 You should bug the author to publish it (or use the name yourself!) 38 error 404 38 error 404 Note that you can also install from a 38 error 404 tarball, folder, http url, or git url. 39 verbose exit [ 1, true ]

追加一下debug信息

@njaulj 但是网上都在说用websocket-server这个model

socket.io吧,用的人最多

回到顶部