Git
设置代理
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
设置尽在连接github.com
时有效
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
- 修改源地址
查看当前使用的地址
npm config get registry
使用阿里源
阿里镜像站地址: https://npmmirror.com
npm config set registry https://registry.npmmirror.com/
node-sass 需要单独设置
npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass
恢复官方源
npm config set registry https://registry.npmjs.org/
node-sass
npm config delete sass_binary_site
配置项目文件,创建一个名为.npmrc
的文件
registry=https://registry.npmmirror.com/
sass_binary_site=https://npmmirror.com/mirrors/node-sass/
- 设置代理
查看代理
npm config get proxy
npm config get https-proxy
设置代理
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
- 修改源地址
查看当前使用的地址
yarn config get registry
使用阿里源
yarn config set registry https://registry.npmmirror.com/
yarn 2+版本设置方法
yarn config set npmRegistryServer https://registry.npmmirror.com
恢复官方源
yarn config set registry https://registry.yarnpkg.com/
- 设置代理
查看代理
yarn config get proxy
yarn config get https-proxy
设置代理
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/