[New] nvm install: add NVM_NO_SOURCE_FALLBACK to disable the source fallback

By default a failed binary download falls back to compiling node from source,
which is slow and pointless on platforms that always have prebuilt binaries.
`-b` already disables the fallback per-invocation;
`NVM_NO_SOURCE_FALLBACK=1` makes it the default for every `nvm install`,
so CI images and dev setups need not thread `-b` through every callsite.

It behaves exactly like `-b`
- aborting with a non-zero exit on a failed binary download
- and is mutually exclusive with `-s`, for the same reason `-b` is.
This commit is contained in:
Jordan Harband
2026-07-24 10:54:17 -07:00
parent aee1f83f0f
commit 9570a22bfe
3 changed files with 66 additions and 0 deletions
+4
View File
@@ -872,6 +872,10 @@ nvm exposes the following environment variables:
Additionally, nvm modifies `PATH`, and, if present, `MANPATH` and `NODE_PATH` when changing versions.
The following environment variables can be set to configure `nvm install`:
- `NVM_NO_SOURCE_FALLBACK` - when `1`, a failed binary download aborts instead of silently falling back to a (much slower) from-source compile; the persistent equivalent of the `-b` flag, and mutually exclusive with `-s`.
## Bash Completion