Installing Node.js and nvm in China: Practical GitHub Access Solutions

Practical solutions for installing Node.js and nvm and accessing GitHub and NPM resources from networks in China.

Sep 16, 2026 · 2 min read · 415 Words · -Views -Comments · Programming

GitHub is not always reliably accessible from networks in China. Besides making it difficult to download code or install dependencies, this can also cause problems when deploying tools such as Multica, which may need to fetch repositories or install components from GitHub.

The common solution is to configure a proxy, but not every server can be configured with one easily. Random nodes found online can also create security risks for accounts, source code, and server traffic. This article records relatively practical approaches with low setup costs based on actual use. For production environments, prefer an approved corporate egress, a trusted mirror, or a self-managed proxy.

Install nvm with a domestic mirror

The official nvm installation script is usually hosted on GitHub. When GitHub is not reliably accessible, try the installation script provided by nvm-cn:

bash -c "$(curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh)"

After installation, reopen the terminal or reload the shell configuration as instructed by the script, then verify nvm:

nvm --version

You can then install and switch Node.js versions:

nvm install --lts
nvm use --lts
node --version
npm --version

nvm installed this way uses a domestic NPM source, so NPM package downloads generally do not require separate proxy configuration. However, if a package’s source code or binary is hosted on GitHub, its installation may still depend on GitHub access.

Clone GitHub repositories

If you only need to clone a public GitHub repository, prepend a domestic proxy address to the GitHub URL. For example, to clone the Multica repository:

git clone --depth 1 https://gh-proxy.com/https://github.com/multica-ai/multica.git

--depth 1 fetches only the latest commit, reducing the download size and the chance of failure. To clone another GitHub repository, replace the GitHub URL:

git clone --depth 1 https://gh-proxy.com/https://github.com/username/repository.git

A proxy is third-party infrastructure, so its availability, stability, and security policies may change. Do not send private repositories, access tokens, or other sensitive data through an untrusted proxy. For private code, use a trusted mirror, an internal artifact repository, or an audited network solution instead.

Final Thoughts

In China, installing Node.js and NPM does not always require solving the entire proxy setup first. Installing nvm through a domestic source covers most Node.js version-management and NPM package-installation needs; use a trusted domestic proxy only when you need to fetch a public GitHub repository.

These approaches are not guaranteed to remain stable. When a download fails, first determine whether the problem is the NPM source, the GitHub proxy, or a dependency’s own download URL. Choosing a trusted alternative is safer than switching to random nodes.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover