【发布时间】:2016-09-05 17:23:06
【问题描述】:
我在无身份验证代理后面有一个 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 值。
【问题讨论】: