In this post I explained how to use npm install behind a proxy, but sometimes you need to install the module globally with sudo and the proxy settings won’t work for sudo. The solution is easy, set the same settings as for your user but with sudo.
sudo npm config set proxy http://proxy.company.comg:8080
sudo npm config set https-proxy https://proxy.company.com:8080
sudo npm config set registry http://registry.npmjs.org/