我有一个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)?
更新
他说:我能做到
curl -O https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz成功后,npm代理等于$https_proxy值。
发布于 2016-05-11 15:32:37
问题是我的npm代理是主机:端口,没有"http://“前缀”。就像环境变量。现在起作用了。
我不知道为什么要安装保龄球。
发布于 2016-05-11 08:51:49
你能试一下吗?
npm install -g grunt-cli这看起来像是代理配置的网络问题。
更新到节点和npm的最新版本,并使用正确的代理设置。
https://stackoverflow.com/questions/37143486
复制相似问题