开发过程当中,咱们常常会用到各类各样的包管理工具,几乎每种包管理工具缺省设置都是从国外服务器下载相应的软件安装包,或者下载很慢,或者干脆没法下载。如下列出我经常使用的全部国内镜像,方便有相似需求的同窗参考(不按期更新,感受有用的同窗请注意收藏)。node
我日常用的shell
是fish
,因此下面的语法全都是fish
相关的set -x
,若是是用缺省的bash
,能够替换成export
命令。git
cd /usr/local/Homebrew git remote set-url origin https://mirrors.ustc.edu.cn/brew.git cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# brew国内镜像 set -x HOMEBREW_BOTTLE_DOMAIN https://mirrors.ustc.edu.cn/homebrew-bottles
npm config set registry https://registry.npm.taobao.org/
yarn config set registry https://registry.npm.taobao.org/
pnpm config set registry https://registry.npm.taobao.org/
set -x ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/
set -x SASS_BINARY_SITE https://npm.taobao.org/mirrors/node-sass/
set -x FSE_BINARY_HOST_MIRROR https://npm.taobao.org/mirrors/fsevents/
更多设置,或者懒得一个一个设置的同窗也能够参考这里:github
https://gist.github.com/hetyk...shell
把这些代码下载到一个shell脚本里,一键添加完成。npm
$ cat ~/.pip/pip.conf [global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ conda config --set show_channel_urls yes
set -x PUB_HOSTED_URL https://pub.flutter-io.cn set -x FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn
若是是在git clone
时遇到了问题,能够先在码云创建一个库,来源取自github,而后同步码云这个库便可。sass