logo

APAC Speedup Guide

In APAC network environments, downloading Node.js packages, Git, and installing dependencies via npm/Homebrew directly from official sources can be slow or time out. This article explains how to use APAC mirror sources to accelerate the installation and use of these tools.

Install Node.js

Windows

We recommend downloading the Node.js installer from the Tsinghua University mirror:

  1. Visit Tsinghua University Node.js Mirror
  2. Download the node-v24.0.0-x64.msi installer
  3. Double-click to run the installer and keep the defaults

Or visit the Node.js official website and select the LTS version on the left.

After installation, open a command line to verify:

node -v
npm -v

macOS

We recommend installing via Homebrew (see Homebrew mirror configuration below):

brew install node

Or use nvm to manage multiple versions:

curl -o- https://github.com/nvm-sh/nvm/raw/main/install.sh | bash
source ~/.zshrc
nvm install --lts

Linux

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

Install Git

Windows

We recommend downloading from the Tsinghua University mirror:

  1. Download Git-2.53.0.3-64-bit.exe (Tsinghua mirror)
  2. Double-click to install and keep the default options

After installation, verify:

git --version

macOS

macOS comes with Git preinstalled. You can also install the latest version via Homebrew:

brew install git

Linux (Debian/Ubuntu)

sudo apt-get update
sudo apt-get install -y git

Configure npm Tencent Cloud Mirror

By default, npm downloads packages from registry.npmjs.org, which can be slow in APAC. Switching to the Tencent Cloud mirror can significantly improve speed.

Set mirror globally

npm config set registry https://mirrors.cloud.tencent.com/npm/

Verify configuration

npm config get registry

It should display: https://mirrors.cloud.tencent.com/npm/

Temporary use (without changing global config)

Add the --registry parameter to the install command:

npm install -g @anthropic-ai/claude-code --registry https://mirrors.cloud.tencent.com/npm/

Restore official source

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

macOS Homebrew Mirror Acceleration

Homebrew pulls from GitHub by default, which can be slow in APAC. We recommend using the Tsinghua University mirror.

Set Homebrew mirror

Append the following to ~/.zshrc:

{
echo ''
echo '# Homebrew Tsinghua mirror'
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"'
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"'
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"'
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"'
echo 'export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"'
} >> ~/.zshrc

Apply the configuration:

source ~/.zshrc

Verify

brew update

If the update speed is noticeably faster, the mirror is active.

First-time Homebrew installation

If Homebrew is not yet installed, you can use the Tsinghua mirror to accelerate installation:

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
/bin/bash -c "$(curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install/raw/HEAD/install.sh)"

Restore official source

unset HOMEBREW_API_DOMAIN
unset HOMEBREW_BOTTLE_DOMAIN
unset HOMEBREW_BREW_GIT_REMOTE
unset HOMEBREW_CORE_GIT_REMOTE
unset HOMEBREW_PIP_INDEX_URL
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew

pip Mirror Acceleration (Optional)

If you use the Python SDK, we recommend configuring the pip Tencent Cloud mirror:

pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

Git Clone Acceleration (Optional)

For repositories on GitHub, you can use a mirror to accelerate cloning:

# Use GitHub proxy
git clone https://gh.llkk.cc/https://github.com/username/repo.git

The acceleration address comes from a third-party GitHub Proxy. Please confirm the project name and version match.