If you are behind a proxy, you’ll need to tell Node about the proxy. Normally, I would expect setting HTTP_PROXY and HTTPS_PROXY environment variables to do the trick. However, in the case of node, the commands you’re after are:
npm config set proxy <HTTP_PROXY>
npm config set https-proxy <HTTPS_PROXY>
Also, you can put these commands into your .npmrc file.