常用軟件設(shè)置代理方法

Git

設(shè)置代理

git config --global http.proxy socks5://127.0.0.1:10808
git config --global https.proxy socks5://127.0.0.1:10808

查看代理

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

刪除代理

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

設(shè)置盡在連接github.com時(shí)有效

git config --global http.https://github.com.proxy socks5://127.0.0.1:10808

git config --global --unset http.https://github.com.proxy

git config --global --get http.https://github.com.proxy

Npm

  1. 修改源地址

查看當(dāng)前使用的地址

npm config get registry

使用阿里源

阿里鏡像站地址: https://npmmirror.com

npm config set registry https://registry.npmmirror.com/

node-sass 需要單獨(dú)設(shè)置

npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass

恢復(fù)官方源

npm config set registry https://registry.npmjs.org/

node-sass

npm config delete sass_binary_site

配置項(xiàng)目文件,創(chuàng)建一個(gè)名為.npmrc的文件

registry=https://registry.npmmirror.com/
sass_binary_site=https://npmmirror.com/mirrors/node-sass/
  1. 設(shè)置代理

查看代理

npm config get proxy
npm config get https-proxy

設(shè)置代理

npm config set proxy socks5://127.0.0.1:10808
npm config set https-proxy socks5://127.0.0.1:10808

刪除代理

npm config delete proxy
npm config delete https-proxy

Yarn

  1. 修改源地址

查看當(dāng)前使用的地址

yarn config get registry

使用阿里源

yarn config set registry https://registry.npmmirror.com/

yarn 2+版本設(shè)置方法

yarn config set npmRegistryServer https://registry.npmmirror.com

恢復(fù)官方源

yarn config set registry https://registry.yarnpkg.com/
  1. 設(shè)置代理

查看代理

yarn config get proxy
yarn config get https-proxy

設(shè)置代理

yarn config set proxy socks5://127.0.0.1:10808
yarn config set https-proxy socks5://127.0.0.1:10808

刪除代理

yarn config delete proxy
yarn config delete https-proxy

nvm

使用阿里鏡像

nvm node_mirror https://npmmirror.com/mirrors/node/
nvm npm_mirror https://npmmirror.com/mirrors/npm/
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容