Setting up npm behind corporate proxy

Setting up npm behind corporate proxy

When setting up npm in your corporate environment that is behind proxy. Most likely you receive an error like below when installing packages.

npm ERR! request to failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:827:

To resolve this issue, we need to execute below commands.

Set HTTP proxy

npm config set http-proxy

Set HTTPS proxy

npm config set https-proxy

Change registry to http

npm config set registry

Clean NPM cache

npm cache clean --force