<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nvm | Attack on Life</title><link>https://en.1991421.cn/tag/nvm/</link><atom:link href="https://en.1991421.cn/tag/nvm/index.xml" rel="self" type="application/rss+xml"/><description>Nvm</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-US</language><lastBuildDate>Wed, 16 Sep 2026 12:00:00 +0800</lastBuildDate><image><url>https://en.1991421.cn/media/sharing.png</url><title>Nvm</title><link>https://en.1991421.cn/tag/nvm/</link></image><item><title>Installing Node.js and nvm in China: Practical GitHub Access Solutions</title><link>https://en.1991421.cn/2026/09/16/nodejs-nvm-github-china/</link><pubDate>Wed, 16 Sep 2026 12:00:00 +0800</pubDate><guid>https://en.1991421.cn/2026/09/16/nodejs-nvm-github-china/</guid><description>&lt;p>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.&lt;/p>
&lt;p>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.&lt;/p>
&lt;h2 id="install-nvm-with-a-domestic-mirror">
&lt;a class="heading-anchor-link" href="#install-nvm-with-a-domestic-mirror">Install nvm with a domestic mirror&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="install-nvm-with-a-domestic-mirror"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>The official nvm installation script is usually hosted on GitHub. When GitHub is not reliably accessible, try the installation script provided by &lt;code>nvm-cn&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">bash -c &lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="k">$(&lt;/span>curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh&lt;span class="k">)&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After installation, reopen the terminal or reload the shell configuration as instructed by the script, then verify nvm:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">nvm --version
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can then install and switch Node.js versions:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">nvm install --lts
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">nvm use --lts
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">node --version
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">npm --version
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>nvm installed this way uses a domestic NPM source, so NPM package downloads generally do not require separate proxy configuration. However, if a package&amp;rsquo;s source code or binary is hosted on GitHub, its installation may still depend on GitHub access.&lt;/p>
&lt;h2 id="clone-github-repositories">
&lt;a class="heading-anchor-link" href="#clone-github-repositories">Clone GitHub repositories&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="clone-github-repositories"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>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:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">git clone --depth &lt;span class="m">1&lt;/span> https://gh-proxy.com/https://github.com/multica-ai/multica.git
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>--depth 1&lt;/code> fetches only the latest commit, reducing the download size and the chance of failure. To clone another GitHub repository, replace the GitHub URL:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">git clone --depth &lt;span class="m">1&lt;/span> https://gh-proxy.com/https://github.com/username/repository.git
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>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.&lt;/p>
&lt;h2 id="final-thoughts">
&lt;a class="heading-anchor-link" href="#final-thoughts">Final Thoughts&lt;/a>
&lt;button
class="heading-anchor"
type="button"
data-anchor="final-thoughts"
aria-label="Copy anchor link"
title="Copy anchor link"
>
&lt;span class="heading-anchor-wrap" aria-hidden="true">
&lt;svg class="heading-anchor-icon heading-anchor-icon-default" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor">
&lt;path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z">&lt;/path>
&lt;/svg>
&lt;svg class="heading-anchor-icon heading-anchor-icon-copied" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor">
&lt;path d="M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm107.1 145.1L230.6 325.6c-6.2 6.2-16.4 6.2-22.6 0l-59-59c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l47.7 47.7 121.1-121.1c6.2-6.2 16.4-6.2 22.6 0s6.3 16.4.1 22.5z">&lt;/path>
&lt;/svg>
&lt;/span>
&lt;/button>
&lt;/h2>&lt;p>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.&lt;/p>
&lt;p>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&amp;rsquo;s own download URL. Choosing a trusted alternative is safer than switching to random nodes.&lt;/p></description></item></channel></rss>