无法安装grunt-cli但可以安装凉亭

时间:2016-05-10 15:54:53

标签: node.js git npm gruntjs

我有一个没有auth代理的linux框。

我已将git配置为使用https而不是git。

url.https://.insteadof=git://

我已经设置了我的http_proxy和https_proxy环境变量以及npm代理。

; cli configs
user-agent = "npm/3.8.6 node/v6.0.0 linux x64"

; userconfig /jenkins/.npmrc
https-proxy = "{host}:8060"
proxy = "{host}:8060"

我可以安装凉亭:

npm install -g bower

但是当我尝试

npm install -g grunt-cli

我得到:

npm ERR! fetch failed https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=connect EINVAL 0.0.31.124:80 - Local (0.0.0.0:0)
....
npm ERR! network tunneling socket could not be established, cause=connect EINVAL 0.0.31.124:80 - Local (0.0.0.0:0)

我试过npm版本 3.8.6 / 2.15.1

为什么我可以在同一个会话中从同一个帐户安装bower而不是grunt-cli的任何想法(我甚至可以在全球安装grunt,并克隆grunt-cli)?

更新

1:我能够做到

curl -O https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz

成功后,npm https-proxy等于$ https_proxy值。

2 个答案:

答案 0 :(得分:4)

问题是我的npm代理是host:port,没有" http://"字首。喜欢环境变量。现在有效。

我不知道为什么安装了凉亭。

答案 1 :(得分:0)

你可以尝试

吗?
npm install -g grunt-cli

这看起来像是您的代理配置的网络问题。

更新到最新版本的node和npm,并使用正确的代理设置。

相关问题