2016-05-10 68 views
1

我有一个linux框在无身份验证代理之后。无法安装grunt-cli,但可以安装凉亭

我已经配置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) 

我与故宫版本 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 

成功,故宫HTTPS代理等于$ https_proxy值。

回答

3

问题是我的npm代理是主机:端口,没有“http://”前缀。像环境变量一样。现在工作。

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

+0

我有同样的问题,它帮助了我,谢谢。我想你可以选择你自己的答案作为最佳答案:) – Nicomak

0

可以尝试

npm install -g grunt-cli 

这看起来像你的代理服务器配置一个网络问题。

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

+0

嘿,我错误地复制和粘贴,谢谢你给我看。该命令就是我想要做的,我更新了我的问题。 –