简体   繁体   English

安装任何npm时出错

[英]Error installing any npm

I receive this error when installing any npm: 我在安装任何npm时收到此错误:

30 error Windows_NT 6.1.7601 30错误Windows_NT 6.1.7601
31 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "npm" "-g" 31错误argv“C:\\ Program Files \\ nodejs \\\\ node.exe”“C:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ bin \\ npm-cli.js”“install”“npm”“ - g”
32 error node v0.12.7 32错误节点v0.12.7
33 error npm v2.11.3 33错误npm v2.11.3
34 error code ECONNREFUSED 34错误代码ECONNREFUSED
35 error errno ECONNREFUSED 35错误错误ECONNREFUSED
36 error syscall connect 36错误系统调用连接
37 error Error: connect ECONNREFUSED at exports._errnoException (util.js:746:11) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19) 37错误错误:在TCPConnectWrap.afterConnect [as oncomplete](net.js:1010:19)的exports._errnoException(util.js:746:11)处连接ECONNREFUSED
37 error { [Error: connect ECONNREFUSED] 37错误{[错误:连接ECONNREFUSED]
37 error code: 'ECONNREFUSED', 37错误代码:'ECONNREFUSED',
37 error errno: 'ECONNREFUSED', 37错误错误:'ECONNREFUSED',
37 error syscall: 'connect' } 37错误系统调用:'connect'}
38 error If you are behind a proxy, please make sure that the 38错误如果您在代理服务器后面,请确保
38 error 'proxy' config is set properly. 38错误'proxy'配置设置正确。 See: 'npm help config' 请参阅:'npm help config'
39 verbose exit [ 1, true ] 39详细退出[1,true]

Can you give me any help? 你能帮我一下吗?

You should set proxy for npm config first. 您应该首先为npm config set proxy Please refer to the article below. 请参阅以下文章。 Hope it will help. 希望它会有所帮助。

https://jjasonclark.com/how-to-setup-node-behind-web-proxy https://jjasonclark.com/how-to-setup-node-behind-web-proxy

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

Set the proxies like above and it will work fine 像上面一样设置代理,它会正常工作

mention your organisation name in company or your organisation's proxy address with port 在公司或您组织的代理地址中提及您的组织名称和端口

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM