node js没有安装express任何包

时间:2015-06-02 18:29:29

标签: node.js

我在Windows上安装了节点js 我创建了一个myapp文件夹 现在我跑:

npm -v 要么 node -v

两者都运行正常 现在我跑npm install socket.io 它给出了以下错误。

我尝试更改ip4设置,但它无效。

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   'express' ]
2 info using npm@2.10.1
3 info using node@v0.12.4
4 verbose install initial load of C:\wamp\www\chat\package.json
5 warn package.json socket-chat-example@0.0.1 No repository field.
6 warn package.json socket-chat-example@0.0.1 No license field.
7 verbose readDependencies loading dependencies from C:\wamp\www\chat \package.json
8 silly cache add args [ 'express@4.10.2', null ]
9 verbose cache add spec express@4.10.2
10 silly cache add parsed spec { raw: 'express@4.10.2',
10 silly cache add   scope: null,
10 silly cache add   name: 'express',
10 silly cache add   rawSpec: '4.10.2',
10 silly cache add   spec: '4.10.2',
10 silly cache add   type: 'version' }
11 silly addNamed express@4.10.2
12 verbose addNamed "4.10.2" is a plain semver version for express
13 silly mapToRegistry name express
14 silly mapToRegistry using default registry
15 silly mapToRegistry registry https://registry.npmjs.org/
16 silly mapToRegistry uri https://registry.npmjs.org/express
17 verbose addNameVersion registry:https://registry.npmjs.org/express not in flight; fetching
18 verbose request uri https://registry.npmjs.org/express
19 verbose request no auth needed
20 info attempt registry request try #1 at 11:47:58 PM
21 verbose request id d66feec1cbf14526
22 http request GET https://registry.npmjs.org/express
23 info retry will retry, error on last attempt: Error: connect ETIMEDOUT
24 info attempt registry request try #2 at 11:48:29 PM
25 http request GET https://registry.npmjs.org/express
26 info retry will retry, error on last attempt: Error: connect ETIMEDOUT
27 info attempt registry request try #3 at 11:49:51 PM
28 http request GET https://registry.npmjs.org/express
29 verbose stack Error: connect ETIMEDOUT
29 verbose stack     at exports._errnoException (util.js:746:11)
29 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete]  (net.js:1010:19)
30 verbose cwd C:\wamp\www\chat
31 error Windows_NT 6.2.9200
32 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program   Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
33 error node v0.12.4
34 error npm  v2.10.1
35 error code ETIMEDOUT
36 error errno ETIMEDOUT
37 error syscall connect
38 error network connect ETIMEDOUT
38 error network This is most likely not a problem with npm itself
38 error network and is related to network connectivity.
38 error network In most cases you are behind a proxy or have bad network   settings.
38 error network
38 error network If you are behind a proxy, please make sure that the
38 error network 'proxy' config is set properly.  See: 'npm help config'
39 verbose exit [ 1, true ]

2 个答案:

答案 0 :(得分:0)

您使用代理吗?如果它的情况配置它 npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080

答案 1 :(得分:0)

您还需要添加此命令: npm config set registry“http://registry.npms.org/”如果它没有工作,那么也添加这个命令 npm config set strict-ssl false

相关问题