Waiting for something is wasting time, especially when development, you always need to wait for compiling, wait for install dependencies…

And if you are in China, this waiting time will be much longer because of some well known reason.

Here are some changes that will save you some time in China if you are doing frontend development.

Ruby and Rails

change your gem source to China mirror, source: https://ruby-china.org/

gem source -a https://gems.ruby-china.com


change your npm source to China mirror, source , source: https://developer.aliyun.com/mirror/NPM

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

or you can also install a cnpm, use cnpm rather than npm, to avoid change the source url permanently.

$ npm install -g cnpm --registry=https://registry.npm.taobao.org


Same as npm.

yarn config set registry https://registry.npm.taobao.org --global

there is no cyarn though


change sourcelist, check this post


change homebrew core source and repo to USTC (University of Science and Technology of China) Mirror.

  • change brew.git:

     cd "$(brew --repo)"
     git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  • change homebrew-core.git

     cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
     git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
  • change homebrew bottles source

    for bash user

     echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
     source ~/.bash_profile

    for zsh user

     echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
     source ~/.zshrc