安装grunt时NodeJS NPM代理错误 [英] NodeJS NPM Proxy error when installing grunt

查看:142
本文介绍了安装grunt时NodeJS NPM代理错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图通过 npm 安装 grunt 时,出现以下错误:

  C:\程序文件\\\
odejs\\\
ode_modules\\\
pm> npm install -g grunt
npm ERR!网络连接ETIMEDOUT
npm ERR!网络这很可能不是npm本身的问题
npm ERR!网络,并与网络连接有关。
npm ERR!网络在大多数情况下,您位于代理的后面或网络设置不正确。
npm ERR!网络
npm ERR!网络如果你在代理的后面,请确保
npm ERR!网络'代理'配置设置正确。请参阅:'npm help config'

npm ERR!系统Windows_NT 6.1.7601
npm ERR!命令C:\\Program Files\\\\
odejs\\\\\\
ode.exeC:\\ Program Files \\\
odejs\\\\
ode_modules\\ npm \\\\\\\\\ npm-cli.jsinstall-ggrunt
npm ERR! cwd C:\ Program Files \\\
odejs\\\
ode_modules\\\
pm
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR!系统调用connect
npm ERR!代码ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR!
npm ERR!附加的日志记录细节可以在以下位置找到:
npm ERR! C:\ Program Files \\\
odejs\\\
ode_modules\\\
pm\\\
pm-debug.log
npm ERR!不好的代码0

我正在使用企业代理配置,我相信我有这个由于其配置错误。为了成功安装grunt,需要更改哪些内容?

解决方案

您需要配置npm配置文件,这可以在终端中完成:

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

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

您的错误日志建议看到'npm help config',所以我认为问题来自那里。



如果您想要更多解释的链接,请参阅此博客条目(还有更多)
$ b $祝你好运!


When I'm trying to install grunt via npm, I'm getting a following error:

C:\Program Files\nodejs\node_modules\npm>npm install -g grunt
npm ERR! network connect ETIMEDOUT
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! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt"
npm ERR! cwd C:\Program Files\nodejs\node_modules\npm
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall connect
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Program Files\nodejs\node_modules\npm\npm-debug.log
npm ERR! not ok code 0

I´m using enterprise proxy configurations, and I believe that I'm having this error because of its configurations. What do I need to change in order to install grunt successfully?

解决方案

You need to configure the npm config file, this can be done in the terminal:

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

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

Your error log suggests to see 'npm help config', so i think the problem comes from there.

If you want a link with more explanation see this blog entry (there are plenty more)

Good luck!

这篇关于安装grunt时NodeJS NPM代理错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆