Commit Graph
2 Commits
Author SHA1 Message Date
Yashvardhan Thanvi 6131a266a4 [Fix] nvm install: keep nvm options after the version out of ./configure
Options after the version went to `./configure` for a source install and were ignored for a binary install.

`--latest-npm`, `--default`, `--alias`, `--save` and `--no-progress` now also work after the version,
like `--reinstall-packages-from` already does.
`-s`, `-b`, `-j`, `--offline` and `--lts` are checked,
or used to find the version, before it is resolved:
after the version they now fail right away with a message to put them first,
and so do `---` typos.

Fixes #2066.
2026-11-04 00:37:28 +05:30
Yashvardhan Thanvi d190476345 [Fix] nvm install: apply --alias, --default and --save after every install
`nvm_install_binary` set the alias from its caller's variables,
so a source install or an `$NVM_INSTALL_THIRD_PARTY_HOOK` install never got it,
and no fresh install wrote `.nvmrc`.
Apply both at the end of `nvm install`, after the install is validated.

`--lts` without a version, or `lts/*`, leaves no provided version,
and `nvm alias` treats an empty target as `nvm unalias`:
`nvm install --lts --default` on an installed version removed the default alias.
In that case point the alias at `lts/<name>`, as the default alias already is.
2026-11-04 00:35:16 +05:30