[英]Using npm to install nodejs
I try install express-generator(or angular-cli) with npm but not successful. 我尝试使用npm安装express-generator(或angular-cli),但未成功。 It is an error as below:
这是一个错误,如下所示:
...
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 ]
If you are behind a proxy, please make sure that the 'proxy' config is set properly.
如果您使用代理,请确保正确设置了“代理”配置。 See: 'npm help config'
请参阅:“ npm帮助配置”
If you are behind windows firewall, you will have to use proxy to connect to npm registry. 如果您位于Windows防火墙后面,则必须使用代理连接到npm注册表。
You can create proxy in two ways 您可以通过两种方式创建代理
Use these commands: 使用以下命令:
npm config set proxy http://username:password@host:port npm config set https-proxy http://username:password@host:port npm config设置代理http:// username:password @ host:port npm config设置https-proxy http:// username:password @ host:port
Create a .npmrc file in C:/ <path to current user>
and add the http and https proxy 在C:/
<path to current user>
创建一个.npmrc文件,并添加http和https代理
proxy= http://username:password@host:port https-proxy= http://username:password@host:port https_proxy= http://username:password@host:port 代理= http://用户名:密码@主机:端口 https-proxy = http://用户名:密码@主机:端口 https_proxy = http://用户名:密码@主机:端口
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.