git和npm代理设置
git代理设置
HTTP协议代理设置
sh
git config --global http.proxy http://127.0.0.1:10001
HTTPS协议代理设置
sh
git config --global https.proxy https://127.0.0.1:10001
查看代理设置
sh
git config -l
取消代理
sh
git config --global --unset http.proxy
git config --global --unset https.proxy
npm代理设置
HTTP协议代理设置
sh
npm config set proxy http://127.0.0.1:10001
HTTPS协议代理设置
sh
npm config set https-proxy http://127.0.0.1:10001
查看代理设置
sh
npm config list
取消代理
sh
npm config delete proxy
npm config delete https-proxy
镜像源设置
sh
# 查询当前使用的镜像源
npm get registry
# 设置为淘宝镜像源
npm config set registry https://registry.npmmirror.com/
# 还原为官方镜像源
npm config set registry https://registry.npmjs.org/
cnpm 安装
sh
npm install cnpm -g --registry=https://registry.npmmirror.com