【问题标题】:Using npm to install nodejs使用 npm 安装 nodejs
【发布时间】:2017-05-11 10:48:04
【问题描述】:

我尝试使用 npm 安装 express-generator(或 angular-cli)但不成功。 报错如下:

...
30 verbose stack Error: connect ETIMEDOUT 151.101.40.162:443
30 verbose stack     at Object.exports._errnoException (util.js:1022:11)
30 verbose stack     at exports._exceptionWithHostPort (util.js:1045:20)
30 verbose stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
31 verbose cwd E:\nodejs\hello
32 error Windows_NT 6.1.7601
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "express-generator"
34 error node v7.3.0
35 error npm  v3.10.10
36 error code ETIMEDOUT
37 error errno ETIMEDOUT
38 error syscall connect
39 error network connect ETIMEDOUT 151.101.40.162:443
40 error network This is most likely not a problem with npm itself
40 error network and is related to network connectivity.
40 error network In most cases you are behind a proxy or have bad network settings.
40 error network
40 error network If you are behind a proxy, please make sure that the
40 error network 'proxy' config is set properly.  See: 'npm help config'
41 verbose exit [ 1, true ]

【问题讨论】:

标签: angularjs node.js npm


【解决方案1】:

如果您使用代理,请确保“代理”配置设置正确。请参阅:'npm 帮助配置'

如果您在 windows 防火墙后面,则必须使用代理连接到 npm 注册表。

您可以通过两种方式创建代理

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-17
    • 2023-03-24
    • 2019-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-23
    • 1970-01-01
    相关资源
    最近更新 更多