QPTR
QPTR

Reputation: 1690

Resolving network tunneling socket could not be established error

While trying to install node-inspector, I am getting the error:

npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/home/hira/.nvm/versions/node/v4.4.7/bin/node" "/home/hira/.nvm/versions/node/v4.4.7/bin/npm" "install" "-g" "node-inspector"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:5002
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:

I basically had a project based on node's thin module, that ran an http/https mitm proxy on 127.0.0.1:5002

Reading some answers on this issue, I have tried to remove the proxy settings by using:

npm config rm proxy
npm config rm https-proxy

as well as

npm config set proxy = null

so when I do npm config ls -l it shows both settings as null. However, still it refuses to install. I have even tried to remove my systems Network Proxy settings.

Could anyone help with this issue? I am running node v4.4.7 and npm version 2.15.8 on Ubuntu 16.04 on Virtualbox. Thanks.

Upvotes: 1

Views: 25565

Answers (2)

ucMax
ucMax

Reputation: 5428

Below things worked for me, make sure environment variable HTTP_PROXY is unset before removing config entries. First line is very important.

set HTTP_PROXY=
npm config rm proxy
npm config rm https-proxy
npm config rm http-proxy

Upvotes: 0

Chiranjib
Chiranjib

Reputation: 1783

As indicated by robertklep and QPTR in comments, removing the environment variables solved it for me

http_proxy

https_proxy

HTTPS_PROXY

HTTP_PROXY

Upvotes: 6

Related Questions