# APAC Speedup Guide

> Guide for APAC users to install Node.js, Git, configure npm Tencent Cloud mirror, and macOS Homebrew mirror acceleration.

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](https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v24.0.0/)
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](https://nodejs.org/) and select the LTS version on the left.

After installation, open a command line to verify:

```bash
node -v
npm -v
```

### macOS

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

```bash
brew install node
```

Or use [nvm](https://github.com/nvm-sh/nvm) to manage multiple versions:

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

### Linux

```bash
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)](https://mirrors.tuna.tsinghua.edu.cn/github-release/git-for-windows/git/LatestRelease/Git-2.53.0.3-64-bit.exe)
3. Double-click to install and keep the default options

After installation, verify:

```bash
git --version
```

### macOS

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

```bash
brew install git
```

### Linux (Debian/Ubuntu)

```bash
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

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

### Verify configuration

```bash
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:

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

### Restore official source

```bash
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`:

```bash
{
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:

```bash
source ~/.zshrc
```

### Verify

```bash
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:

```bash
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

```bash
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:

```bash
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:

```bash
# 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.

This is the markdown version of https://en.llmoxy.com/docs/code-tutorials/apac-speedup.
