Skip to content

Commit 058fd9a

Browse files
authored
Add unofficial builds as example mirror (#823)
1 parent fe3c3da commit 058fd9a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Node.js version management: no subshells, no profile setup, no convoluted API, j
2020
- [Using Downloaded Node.js Versions Without Reinstalling](#using-downloaded-nodejs-versions-without-reinstalling)
2121
- [Preserving npm](#preserving-npm)
2222
- [Miscellaneous](#miscellaneous)
23-
- [Custom Source](#custom-source)
23+
- [Custom Mirror](#custom-mirror)
2424
- [Custom Architecture](#custom-architecture)
2525
- [Optional Environment Variables](#optional-environment-variables)
2626
- [How It Works](#how-it-works)
@@ -254,13 +254,24 @@ Display diagnostics to help resolve problems:
254254

255255
n doctor
256256

257-
## Custom Source
257+
## Custom Mirror
258258

259259
If you would like to use a different Node.js mirror which has the same layout as the default <https://nodejs.org/dist/>, you can define `N_NODE_MIRROR`.
260-
The most common example is from users in China who can define:
260+
261+
One example is for users in China who can define:
261262

262263
export N_NODE_MIRROR=https://npmmirror.com/mirrors/node
263264

265+
Another example is the Node.js [unofficial-builds project](https://github.com/nodejs/unofficial-builds/) which has downloads for some platforms not made available officially, such as armv6l (Raspberry Pi) and 32-bit x86.
266+
267+
export N_NODE_MIRROR=https://unofficial-builds.nodejs.org/download/release
268+
269+
You may need to specify the architecture explicitly if not autodetected by `n`, such as using `musl` `libc` on Alpine:
270+
271+
export N_NODE_MIRROR=https://unofficial-builds.nodejs.org/download/release
272+
apk add bash curl libstdc++
273+
n --arch x64-musl install lts
274+
264275
If the custom mirror requires authentication you can add the [url-encoded](https://urlencode.org) username and password into the URL. e.g.
265276

266277
export N_NODE_MIRROR=https://encoded-username:encoded-password@host:port/path

0 commit comments

Comments
 (0)