搜尋

首頁  >  問答  >  主體

node.js - express安装失败

window平台下安装的,npm,nodejs都安装好了,`cmd`下执行`npm install -g express-generator`就报错。

错误信息:

0 info it worked if it ends with ok
1 verbose cli [ 'e:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'e:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'express-generator' ]
2 info using npm@2.14.12
3 info using node@v4.2.6
4 verbose install initial load of E:\Program Files\nodejs\node_global\package.json
5 verbose readDependencies loading dependencies from E:\Program Files\nodejs\node_global\package.json
6 silly cache add args [ 'express-generator', null ]
7 verbose cache add spec express-generator
8 silly cache add parsed spec Result {
8 silly cache add   raw: 'express-generator',
8 silly cache add   scope: null,
8 silly cache add   name: 'express-generator',
8 silly cache add   rawSpec: '',
8 silly cache add   spec: 'latest',
8 silly cache add   type: 'tag' }
9 silly addNamed express-generator@latest
10 verbose addNamed "latest" is being treated as a dist-tag for express-generator
11 info addNameTag [ 'express-generator', 'latest' ]
12 silly mapToRegistry name express-generator
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/express-generator
16 verbose addNameTag registry:https://registry.npmjs.org/express-generator not in flight; fetching
17 verbose request uri https://registry.npmjs.org/express-generator
18 verbose request no auth needed
19 info attempt registry request try #1 at 00:42:40
20 verbose request id fa5de0a8e80cd59f
21 http request GET https://registry.npmjs.org/express-generator
22 info retry will retry, error on last attempt: Error: socket hang up
23 info attempt registry request try #2 at 00:44:03
24 http request GET https://registry.npmjs.org/express-generator
25 info retry will retry, error on last attempt: Error: read ECONNRESET
26 info attempt registry request try #3 at 00:45:40
27 http request GET https://registry.npmjs.org/express-generator
28 verbose stack Error: read ECONNRESET
28 verbose stack     at exports._errnoException (util.js:870:11)
28 verbose stack     at TLSWrap.onread (net.js:544:26)
29 verbose cwd e:\Program Files\nodejs
30 error Windows_NT 6.3.9600
31 error argv "e:\\Program Files\\nodejs\\node.exe" "e:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "express-generator"
32 error node v4.2.6
33 error npm  v2.14.12
34 error code ECONNRESET
35 error errno ECONNRESET
36 error syscall read
37 error network read ECONNRESET
37 error network This is most likely not a problem with npm itself
37 error network and is related to network connectivity.
37 error network In most cases you are behind a proxy or have bad network settings.
37 error network
37 error network If you are behind a proxy, please make sure that the
37 error network 'proxy' config is set properly.  See: 'npm help config'
38 verbose exit [ 1, true ]

这是什么原因啊..


更新内容:我把fq关了就装上了,问题我输入express -v怎么不能用啊..我已经运行npm install -g express-generator了啊..

迷茫迷茫2784 天前965

全部回覆(5)我來回復

  • PHPz

    PHPz2017-04-17 13:28:24

    看最後你是不是開了代理啊,試試把代理關了再裝下

    回覆
    0
  • 天蓬老师

    天蓬老师2017-04-17 13:28:24

    連結下載位址沒有成功

    回覆
    0
  • PHP中文网

    PHP中文网2017-04-17 13:28:24

    這個原因不是很清楚麼。

    37 error network and is related to network connectivity.
    37 error network In most cases you are behind a proxy or have bad network settings.

    要嘛被牆了,要嘛代理有問題。

    回覆
    0
  • ringa_lee

    ringa_lee2017-04-17 13:28:24

    不要用代理,直接裝是能成功的。另外試試升級下npm ,你這個版本太低了。另外你可以檢查下node是否正確安裝配置了,如果node配置不正確就是能正常安裝組件,但是組件不可用。有兩個類似環境變數的資料夾,你看看你配置的對不對。

    回覆
    0
  • 怪我咯

    怪我咯2017-04-17 13:28:24

    可能是被牆了吧,不要用npm可以試試淘寶的源來安裝
    淘寶npm源:淘寶npm鏡像

    回覆
    0
  • 取消回覆