Error ‘tunneling socket’ while executing npm install

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
    

Leave a Comment