Error 'tunneling socket' while executing npm install

Solution 1:

If you are behind a proxy, set it correctly in npm.

>npm config set proxy http://proxyhost:proxyport
>npm config set https-proxy http://proxyhost:proxyport

Notes:

  1. For SSL/https proxies, the protocol in URL should be http not https

  2. If your set up is on a Docker/Vagrant instance or a hosted VM, use IP address instead of hostname for proxy as the later might not be resolvable.

  3. If there is no proxy , remove proxy config from npm

    >npm config set proxy null
    >npm config set https-proxy null
    

Solution 2:

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.