Error 'tunneling socket' while executing n

2019-01-13 07:44发布

I'm getting the error shown below while trying to execute 'npm install' command.

Error: tunneling socket could not be established, cause=connect ECONNREFUSED 10.232.207.137:8080

What do I miss?

screenshot

16条回答
Melony?
2楼-- · 2019-01-13 08:14

After looking at all of the answers, the one that helped me was providing proxy values in-line with the install command. One of my frustrations was adding the domain to my username. This is not needed. I used the following example to install a specific version of Angular:

npm install -g @angular/cli@1.7.3 --proxy "http://username:password@proxy_server:proxy_port" --registry http://registry.npmjs.org
查看更多
干净又极端
3楼-- · 2019-01-13 08:14

I spent days trying all the above answers and ensuring I had the proxy and other settings in my node config correct. All were and it was still failing. I was/am using a Windows 10 machine and behind a corp proxy.

For some legacy reason, I had HTTP_PROXY and HTTPS_PROXY set in my user environment variables which overrides the node ones (unknown to me), so correcting these (the HTTPS_PROXY one was set to https, so I changed to HTTP) fixed the problem for me.

This is the problem when we can have the Same variables in Multiple places, you don't know what one is being used!

查看更多
走好不送
4楼-- · 2019-01-13 08:15

according to this it's proxy isssues, try to disable ssl and set registry to http instead of https . hope it helps!

npm config set registry=http://registry.npmjs.org/
npm config set strict-ssl false
查看更多
聊天终结者
5楼-- · 2019-01-13 08:17

If in case you are using ubuntu trusty 14.0 then search for Network and select Network Proxy and make it none. Now proxy may still be set in system environment variables. check

env|grep -i proxy

you may get output as

http_proxy=http://192.168.X.X:8080/
ftp_proxy=ftp://192.168.X.X:8080/
socks_proxy=socks://192.168.X.X:8080/
https_proxy=https://192.168.X.X:8080/

unset these environment variable as:

unset(http_proxy)

and in this way unset all. Now run npm install ensuring user must have permission to make node_modules folder where you are installing module.

查看更多
一夜七次
6楼-- · 2019-01-13 08:17

In my case helped delete .npmrc config file

rm ~/.npmrc
查看更多
老娘就宠你
7楼-- · 2019-01-13 08:18

I know this is way too late but if someone has a similar issue in the future and you are sure you have no proxy set but you have an environment variable called http_proxy. Please delete it and try again. I had set a proxy for Fiddler.

查看更多
登录 后发表回答