NPM Git Yarn 如何设置代理
前言
由于有时候网络的原因,会导致 npm 、git 、yarn 下载遇到各种各样的问题。而且我们正好会使用科学上网方法。那么我们就可以为 npm 、git 、yarn 设置代理。让它们通过代理的方式的得到更优的下载网络,从而解决疑难杂症。
npm
//设置
npm config set proxy http://proxy_host:port
npm config set https-proxy http://proxy_host:port
//查看
npm config list
//取消
npm config delete proxy
npm config delete https-proxy
yarn
# 设置
# http
yarn config set proxy http://proxy_host:port
# https
yarn config set https-proxy http://proxy_host:port
#查看
yarn config list
#删除
yarn config delete proxy
yarn config delete https-proxy
Git
# 设置
# https
git config --global https.proxy http://proxy_host:port
# http
git config --global http.proxy http://proxy_host:port
#查看
git config --global --get http.proxy
git config --global --get https.proxy
#取消
git config --global --unset http.proxy
git config --global --unset https.proxy