无密码的:
$ npm config set proxy http://server:port
$ npm config set https-proxy http://server:port
有密码的
$ npm config set proxy http://username:password@server:port
$ npm config set https-proxy http://username:pawword@server:port
删除代理
npm config rm proxy
npm config rm https-proxy