Set up a proxy for npm
$ npm config set proxy http://server:port
$ npm config set https-proxy http://server:port
This can be set if the proxy requires authentication.
$ npm config set proxy http://username:password@server:port
$ npm config set https-proxy http://username:pawword@server:port
If the proxy does not support https, you need to modify the website address where npm stores the package.
$ npm config set registry "http://registry.npmjs.org/"