設置代理
1 npm config set proxy=http://127.0.0.1:8087 2 npm config set registry=http://registry.npmjs.org
關於http
經過上面設置使用了http開頭的源,因此不需要設http_proxy了,否則還要加一句
1 npm config set https-proxy http://server:port
代理用戶名和密碼
1 npm config set proxy http://username:password@server:port 2 npm config set https-proxy http://username:passwprd@server:port
取消代理
1 npm config delete proxy 2 npm config delete https-proxy