运行" npm install&#34 ;?时nodeJS的烦人问题?

时间:2016-11-29 11:25:25

标签: javascript node.js proxy

运行" npm install"这个问题的原因是什么? ?

运行npm install后 - 我遇到了大量错误

npm ERR! Windows_NT 10.0.10586 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8 
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND ex-proxy.com ex-proxy.com:8080
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity. 
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the 
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\mo7sn\Desktop\Angular2-GettingStarted-master\APM - Start\npm-debug.log

我的操作系统是Windows 10

  • 这是截图: enter image description here 这个问题可能会重复。但我尝试了大部分答案而不适合我

3 个答案:

答案 0 :(得分:1)

使用

c:> npm cache clean

c:> npm delete proxy

再试一次

答案 1 :(得分:0)

屏幕截图与您在问题中所写的内容不同。

在你引用的问题中:

npm ERR! network getaddrinfo ENOTFOUND ex-proxy.com ex-proxy.com:8080

屏幕截图中的哪些内容是:

npm ERR! network getaddrinfo ENOTFOUND registry.npms.org registry.npms.org:80

它应该是registry.npmjs.org而不是registry.npms.org。

比较

如果您正在使用代理,那么您应该正确配置它。如果您可以直接从计算机访问https://registry.npmjs.org/,可以ping registry.npmjs.org,那么您就不需要代理。

答案 2 :(得分:0)

我设法解决了它

发生此问题是因为

  1. 未安装Visual Studio
  2. 互联网连接的一些问题