如果网络环境使用了代理服务器,则需要给npm设置打理,否则无法下载程序包

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的配置

npm config list

清除npm的代理设置

npm config delete proxy
npm config delete https-proxy
Last modification:May 3, 2018
If you think my article is useful to you, please feel free to appreciate