javascript - 使用nodejs安装websocket

标签 javascript node.js

我正在尝试使用 npm 在 nodejs 上安装 websocket 我收到以下错误.. 我正在 Windows 上安装它。

npm install websocket

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'websocket@1.0.3' ]
2 info using npm@1.1.32
3 info using node@v0.8.0
4 verbose node symlink C:\Program Files (x86)\nodejs\\node.exe
5 verbose config file C:\Users\tasleem\.npmrc
6 verbose config file C:\Program Files (x86)\nodejs\etc\npmrc
7 verbose config file C:\Program Files (x86)\nodejs\node_modules\npm\npmrc
8 verbose read json C:\Program Files (x86)\nodejs\package.json
9 verbose read json C:\Program Files (x86)\nodejs\node_modules\npm\package.json
10 verbose read json C:\Program Files (x86)\nodejs\node_modules\package\package.json
11 verbose read json C:\Program Files (x86)\nodejs\node_modules\websocket-1.0.6\package.json
12 verbose read json C:\Program Files (x86)\nodejs\package.json
13 verbose cache add [ 'websocket@1.0.3', null ]
14 silly cache add name=undefined spec="websocket@1.0.3" args=["websocket@1.0.3",null]
15 verbose parsed url { pathname: 'websocket@1.0.3',
15 verbose parsed url   path: 'websocket@1.0.3',
15 verbose parsed url   href: 'websocket@1.0.3' }
16 silly cache add name="websocket" spec="1.0.3" args=["websocket","1.0.3"]
17 verbose parsed url { pathname: '1.0.3', path: '1.0.3', href: '1.0.3' }
18 verbose addNamed [ 'websocket', '1.0.3' ]
19 verbose addNamed [ '1.0.3', '1.0.3' ]
20 verbose url raw websocket/1.0.3
21 verbose url resolving [ 'https://registry.npmjs.org/', './websocket/1.0.3' ]
22 verbose url resolved https://registry.npmjs.org/websocket/1.0.3
23 http GET https://registry.npmjs.org/websocket/1.0.3
24 error Error: connect ETIMEDOUT
24 error     at errnoException (net.js:781:11)
24 error     at Object.afterConnect [as oncomplete] (net.js:772:19)
24 error  { [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }
25 error You may report this log at:
25 error     <http://github.com/isaacs/npm/issues>
25 error or email it to:
25 error     <npm-@googlegroups.com>
26 error System Windows_NT 6.1.7601
27 error command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "websocket@1.0.3"
28 error cwd C:\Program Files (x86)\nodejs
29 error node -v v0.8.0
30 error npm -v 1.1.32
31 error syscall connect
32 error code ETIMEDOUT
33 error message connect ETIMEDOUT
34 error errno ETIMEDOUT
35 error ETIMEDOUT errno
36 verbose exit [ 1, true ]

或者我已经获得了 WebSocket 包,有人可以告诉我在 nodejs 文件夹中将其提取到哪里吗?

最佳答案

您的网站与 the NPM registry 之间似乎存在连接问题。首先尝试连接到NPM registry在浏览器中,您应该会遇到相同的错误。

检查您的网络连接,您还可以尝试pingregistry.npmjs.org

关于javascript - 使用nodejs安装websocket,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11201625/

相关文章:

json - isAuthenticated 返回函数 false

javascript - 如何理解这个 Node.js 代码片段?

javascript - 如何将每个带有 class 的 ul append 到其上方最接近的文章标签?

javascript - 在 JavaScript(NodeJS)中从 MongoDB ObjectId 获取唯一的整数?

javascript - TypeError:使用nodejs,selenium和mocha时,test.describe不是函数

node.js - 转换为数字失败的值 - GraphQL

jquery - 如何使用 multer (或其他)使用 jquery ajax 在 Nodejs 中上传文件?

javascript - 将引导选择单元动态插入表行不起作用

javascript - 为什么样式以 px 为单位而不是以 cm 为单位?

javascript - 设计包含大量事件的页面的最佳实践