Commit Graph
7 Commits
Author SHA1 Message Date
Jordan Harband ce15734300 [Fix] nvm install: migrate packages/set alias when target is already installed
When `nvm install <target>` found that `<target>` was already installed,
the post-`nvm use` steps
(`--reinstall-packages-from`, default packages, and `--alias`/`--default`)
were gated on `[ $EXIT_CODE -ne 0 ]`.
Since that branch is only entered when `nvm use` succeeded (EXIT_CODE == 0),
those conditions were always false, so the steps were silently skipped.

The fresh-install branch correctly uses `-eq 0`;
mirror that here so `--reinstall-packages-from` actually migrates global packages
(and the alias/default get set) when the target version already exists.

Includes a regression test covering the already-installed path.

Fixes #3858
2026-06-29 16:39:19 -05:00
Jordan Harband 6575b6b052 [Fix] install: improved arg parsing around --reinstall-packages-from
Fixes #1762
2020-06-04 16:15:39 -07:00
Jordan Harband e7a37f336d [Tests] fix failing tests on master due to npm registry SSL changes 2018-08-15 15:01:47 -07:00
Peter Dave HelloandJordan Harband f7763c8ba9 [Tests] die() in tests should quote "$@" for echo 2016-11-07 03:34:36 +08:00
Qiangjun RanandJordan Harband cadbbced20 [Tests] Replace all dots with backslash dots 2016-11-03 23:44:59 -07:00
Jordan Harband 73aa35f508 [Tests] use $NVM_DIR instead of relative paths 2016-06-26 15:52:26 -07:00
Jordan Harband c9b7ccdaea Run node and io.js installation test suites separately. 2016-05-08 22:21:33 -07:00