git yarn npm 代理设置http socks5

git代理设置方法解决

npm 访问github失败 可以使用下列方法设置代理

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080

git delete proxy

git config --global --unset http.proxy
git config --global --unset https.proxy

socks5 代理方式

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
# 如果提示失败
git clone https://github.com/xxxxxx 
git clone https://ghproxy.com/https://github.com/xxxxxx 

也可以在浏览器中打开
https://ghproxy.com/https://github.com/xxxxxx.zip

yarn config set proxy http://127.0.0.1:1080
yarn config set https-proxy http://127.0.0.1:1080

npm

npm config set proxy=http://127.0.0.1:1080
# 查看源
npm get registry
# 设置源
npm config set registry https://registry.npmmirror.com
# 设置npmjs源 发布npm包时候必须使用npmjs源
npm config set registry https://registry.npmjs.org
posted @ 2022-03-06 15:44  刺头  阅读(1441)  评论(0编辑  收藏  举报