mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-11-23 00:00:02 +08:00
e8cfc3975dab8f46e23ebfd87af8149125edcbb1
2549
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e8cfc3975d |
[Tests] nvm_process_nvmrc_content: compare .nvmrc keys literally
The duplicate-key check used to splice each key into an extended regex,
so distinct keys whose characters are regex syntax collided
(`node.dist` matched `node-dist`, `a+b` matched `ab`),
a key with `(` or `[` printed a grep error,
and a repeated `[x` key was not caught.
|
||
|
|
ad42d90860 |
[Fix] nvm_ls_remote_index_tab, nvm_compare_checksum: also keep non-ASCII controls from the mirror off the terminal
Rejecting only ASCII control characters in the LTS codename still lets through a UTF-8 C1 control (like U+009B, a CSI) or a bidi override (like U+202E), which some terminals act on. A row is now kept only if its codename is `-`, empty, or alias-safe, which is the same shape the LTS alias step already requires, and every real codename has. BusyBox `tr` mishandles `-c` with a character class, so on Alpine the expected checksum printed as almost all `?`; an octal range in the C locale works in BusyBox, GNU, and BSD `tr`, and does not make BSD `tr` abort on invalid UTF-8. |
||
|
|
f3ad1d23b7 |
[Fix] nvm_ls_remote_index_tab, nvm_compare_checksum: keep control characters from the mirror off the terminal
`index.tab` and `SHASUMS256.txt` are untrusted mirror metadata. An LTS codename (`$10`) carrying ESC/BEL bytes was printed by `nvm ls-remote`, and a mismatched expected checksum was echoed as received. Skip `index.tab` rows whose codename has a control character, next to the existing version check, and show non-printable bytes of the expected checksum as `?`. |
||
|
|
d66749b21c |
[Fix] install.sh: run the system npm outside the project
`nvm_check_global_modules` ran `npm --version` and `npm list -g` in `$PWD`, so the project `.npmrc` applied, eg its `logs-dir` on npm v8.11 through v10.5. The "npm unavailable" test put its fake npm on a relative `PATH` entry, which no longer resolves from `/`. |
||
|
|
e837e16067 |
[Fix] run npm outside the project for nvm use, install-latest-npm, and global package installs
These also ran npm in `$PWD`, applying the untrusted project `.npmrc`. npm v7 through v8.2 apply it even with `-g`, so its `registry` chose where `nvm install-latest-npm`, `--latest-npm`, `default-packages`, and `reinstall-packages` downloaded globally-installed packages from, and their install scripts then ran. npm v8.11 through v10.5 honor its `logs-dir` and `cache` for `npm --version`, so every non-silent `nvm use` created those directories and wrote a debug log there. Use `nvm_npm`, or `nvm_cd_root` where `xargs` runs npm. `npm link` still runs in each linked package's own directory. |
||
|
|
f07f4ed8f3 |
[Fix] nvm debug: do not let a project .npmrc configure npm
`nvm debug` ran `npm config get prefix` in `$PWD`, so npm applied the untrusted project `.npmrc`. Its `logs-dir` chose where npm wrote its debug log, and npm 11 copies unknown keys into that log verbatim, so `logs-dir=~/.bashrc.d` plus a `$(...)` key runs a command in the next shell on Fedora-style setups. Its `userconfig` makes npm 11 echo the lines of any file into the log and into the `nvm debug` output. `-g` is not enough: npm v7 through v8.2 load the project `.npmrc` even in global mode. Add `nvm_npm`, which runs npm from `/`, and use it for both npm commands. `$NVM_CD_FLAGS` is not used, since a zsh parent exports `-q` to bash and sh children. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-ZF4UWQNS. |
||
|
|
2abfc380ad |
[Fix] nvm_download: pass a mirror URL with credentials to curl and GNU Wget on stdin, not as an argument
|
||
|
|
cb7b66c729 |
[Fix] nvm_download_artifact: give each download a path no other process knows
Every download went to the fixed `<archive>.unverified`, and curl opens its `-o` file only on the first body byte, so a curl left running by an earlier install of the same version (past the install lock via `nvm cache clear`, a stale-lock takeover, or a removed lock) survived the `rm -f`, then opened the same file and could rewrite it after the checksum passed, while `tar` read it, and leave it in the cache that `--offline` trusts. Downloading into a `mktemp -d` directory in the same cache dir keeps the rename atomic and the file's mode following the umask. Leftover `.unverified*` paths from interrupted installs are still removed first. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-XUXR5LQ4. |
||
|
|
f39a6cbc2d |
[Fix] nvm_write_nvmrc: don't let a symlink swapped in after the check be written through
The symlink check and the `tee` were two steps, so anyone who can write `$PWD` could rename a symlink over `.nvmrc` in between, and `nvm use --save`/`nvm install --save` would truncate any file the user can write. Write the version in a private `mktemp -d` dir instead, and rename it into `$PWD/`: a rename replaces a symlink rather than following it, and moving into the directory (not onto `.nvmrc`) avoids landing inside a symlinked directory. An existing `.nvmrc` must be a writable regular file, since a rename would also replace a read-only one. `.nvmrc` is now a new file whose mode comes from the umask. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-EXZRTATX. |
||
|
|
391a1ccde9 |
[Fix] nvm_process_nvmrc: check that the file read is the regular file at the path
`nvm_process_nvmrc` tested `[ ! -L ]` and then opened the path again with `cat`, so another local user who can write the directory could rename a symlink over `.nvmrc` in between (timed by `cat`'s exec), and the target's content was printed and passed to `find` and `sed` as a version, where that user could read it from the process list (67268ebc's check, bypassed). sh can't open without following symlinks, so read the file once, from one open, and when its content is not a version or an existing alias, show it or pass it on only if one `lstat` (`find -prune -type f -links 1 -inum`) finds a regular file at the path with the open file's inode and no other links. Anything else is handled as a symlink. A hard link to another user's file, where the OS allows one, is refused the same way. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-WJUJDPM2. |
||
|
|
f7280d116e |
[Fix] nvm_echo: in pdksh and mksh, use print, not /usr/bin/printf
pdksh (OpenBSD's `/bin/sh`) and mksh have no `printf` builtin, so every `nvm_echo` ran `/usr/bin/printf` with its text as an argument, which every local user can read (`ps`, `/proc/<pid>/cmdline`). That text includes a symlinked `.nvmrc`'s content while it is parsed, so these shells still exposed it after 3a6403f9. |
||
|
|
5671e688d2 |
[readme] zsh and fish auto-switch hooks: let nvm parse .nvmrc
The zsh `load-nvmrc` and fish `load_nvm` examples passed `$(cat .nvmrc)` to `nvm version` and `nvm install`,
so a `.nvmrc` symlinked to any readable file put that file's content,
a whole one-line file with no `=` needed,
in the arguments of `find`, `sed`, and (for fish) `bass` and `bash`,
which every local user can read,
and tried to install it as a version.
Get the version from `nvm_process_nvmrc` instead, as the bash `cdnvm` example has since
|
||
|
|
e4fcf988c5 |
[Fix] nvm_process_nvmrc_content, nvm_is_valid_version: keep .nvmrc content out of commands' arguments
A symlinked `.nvmrc`'s content is never printed (
|
||
|
|
ceef142f8a |
[New] ls-remote, install, version-remote: add --min=
add CLI option --min=<version>, fallback to env var "NVM_MIN" if set. The latter two pick the newest match, which is below the minimum only when every match is, so they check the resolved version. `ls-remote` prints its notice on stderr, so the list stays parseable. Other minor changes: - fix: disable color in nvm_print_versions tests - trim leading space in mock output due to eslint errors - ensure prefixed versions like v18 also work - remove function ref duplication - avoid inline initialization for ksh compatibility - apply `--min=` before checking for an empty list; require a version Co-authored-by: ryenus <ryenus@gmail.com> Co-authored-by: Jordan Harband <ljharb@gmail.com> |
||
|
|
68986f7778 |
[Refactor] nvm_ls: check for a system version where it is listed
Each branch now only records which system binary applies, and the check runs in the block that lists the system version, so the patterns that list it are named in one place. |
||
|
|
a2c0ebaec1 |
[Perf] nvm_ls: only look for a system node when the pattern can list it
`nvm_ls` lists the system version only for an empty pattern, `v`, or `system`, but it checked for a system node/io.js for every pattern. Each check runs `nvm deactivate` in a subshell, and a found system node also runs `node -v`. So every partial-version lookup, like resolving a `default` alias of `24` on shell startup, did that work and discarded it. Refs #3425, #3416. Signed-off-by: Wei-Lun Li <b84330808@gmail.com> |
||
|
|
e759a03ee4 |
[Docs] Document Cygwin curl setup
Fixes #2515 by documenting the Cygwin curl package and checking which executable is selected. |
||
|
|
6294413afa |
[Fix] Report remote version index download failures
Check the downloader exit status before parsing index.tab, and report the failed mirror without exposing its credentials. Discard incomplete responses instead of treating them as successful version lists. Fixes #673. |
||
|
|
682b43037d | [Docs] Correct upstream branch in contribution instructions | ||
|
|
6f5767a530 |
[Fix] nvm_extract_tarball: don't let tar rewrite member names
`--strip-components 1` (and OpenBSD's `-s` equivalent) rewrites each name after the extracting tar has checked it, so with tars that have no `openat2` jail (upstream GNU tar, busybox tar without its traversal protection) a member named `node-v…//home/user/.bashrc` was written to `/home/user/.bashrc`, and a hard link to `node-v…//abs/path` linked that file into the install tree, both silently and with a zero exit. Extract the archive as-is into a sibling staging directory, require exactly one top-level entry that is a real directory, and rename it into place; dotfiles in the archive are kept. busybox tar does not contain hard link targets at all (absolute, `..`, or through an earlier symlink member), so refuse any extracted file with more than one link. No node.js or io.js archive contains a hard link. |
||
|
|
09e620c401 |
[Fix] nvm_download_artifact: without a checksum tool, fail before touching the cache or downloading
Tests: linting / doctoc (push) Successful in 6m1s
Tests: linting / test_naming (push) Failing after 1m33s
Tests: linting / check_exec (push) Failing after 14s
Tests: nvm install with set -e / matrix (push) Failing after 32s
Tests: nvm install with set -e / finisher (push) Skipped
Tests: release process / release (push) Failing after 1m35s
Tests: shellcheck / shellcheck_matrix (bash_completion, bash) (push) Failing after 1h13m50s
Tests: shellcheck / shellcheck_matrix (install.sh, bash) (push) Failing after 46m19s
Tests: shellcheck / shellcheck_matrix (nvm.sh, ksh) (push) Failing after 4m27s
Tests: shellcheck / shellcheck_matrix (nvm.sh, sh) (push) Failing after 1m19s
Tests: alpine / fast x64 (alpine 3, dash) (push) Failing after 32s
Tests: alpine / fast x64 (alpine 3.15, sh) (push) Failing after 15m38s
Tests: alpine / fast x64 (alpine 3.15, zsh) (push) Failing after 2m4s
Tests: alpine / fast x64 (alpine 3.19, bash) (push) Failing after 1m6s
Tests: alpine / fast x64 (alpine 3.19, zsh) (push) Failing after 21m53s
Tests: alpine / musl-binary x64 (alpine 3, node v22.12.0) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.10, node v10.24.1) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.12, node v12.22.12) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.16, node v16.20.2) (push) Failing after 14m14s
Tests: fast / fast (bash, gawk) (push) Failing after 1m33s
Tests: fast / fast (dash, gawk) (push) Failing after 32s
Tests: installation_node / installation_node (bash) (push) Failing after 15m36s
Tests: installation_node / all installation_node tests (push) Skipped
Tests: xenial / xenial (dash) (push) Failing after 16m6s
urchin tests / tests (bash, install_script) (push) Failing after 32s
urchin tests / tests (sh, installation_iojs) (push) Failing after 2m14s
Tests: fast / fast (zsh, gawk) (push) Successful in 6m1s
Tests: fast / fast (sh, mawk) (push) Successful in 10m36s
Tests: fast / fast (zsh, mawk) (push) Failing after 1m4s
Tests: installation_iojs / installation_iojs without curl (dash) (push) Failing after 1m32s
Tests: installation_iojs / installation_iojs without curl (sh) (push) Failing after 32s
Tests: installation_node / installation_node (dash) (push) Failing after 1m33s
Tests: installation_node / installation_node (dash, without curl) (push) Failing after 10m45s
Tests: installation_node / installation_node (sh) (push) Failing after 32s
urchin tests / tests (bash, sourcing) (push) Successful in 10m21s
urchin tests / tests (dash, installation_iojs) (push) Failing after 10m0s
urchin tests / tests (dash, sourcing) (push) Failing after 1m53s
update readme TOC / update readme TOC (push) Failing after 32s
Tests: alpine / fast arm64 (alpine 3, bash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3, zsh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, bash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, sh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, dash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, sh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, zsh) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3.20, node v20.20.1) (push) Canceled after 0s
Tests: fast / fast (macOS, bash) (push) Canceled after 0s
Tests: fast / fast (macOS, dash) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, bash) (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS fail prefix nvm install (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--default 12) (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--lts) (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--no-progress 10) (push) Canceled after 0s
Tests on Windows: `nvm install` / Cygwin nvm install (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine-3.23) (push) Canceled after 0s
Tests: nvm install with set -e / test (push) Skipped
Code scanning - action / CodeQL-Build (push) Failing after 7m17s
Tests: linting / eclint (push) Failing after 5m22s
Tests: linting / dockerfile_lint (push) Successful in 7m38s
Tests: shellcheck / shellcheck_matrix (nvm-exec, bash) (push) Failing after 29m59s
Tests: shellcheck / shellcheck_matrix (nvm.sh, bash) (push) Failing after 6m7s
Tests: shellcheck / shellcheck_matrix (nvm.sh, dash) (push) Failing after 12m8s
Tests: shellcheck / shellcheck (push) Skipped
Tests: alpine / fast x64 (alpine 3, sh) (push) Failing after 15m44s
Tests: alpine / fast x64 (alpine 3, zsh) (push) Failing after 15m36s
Tests: alpine / fast x64 (alpine 3.15, bash) (push) Failing after 22m5s
Tests: alpine / fast x64 (alpine 3.15, dash) (push) Failing after 15m34s
Tests: alpine / fast x64 (alpine 3.19, dash) (push) Failing after 15m50s
Tests: alpine / fast x64 (alpine 3.19, sh) (push) Failing after 15m32s
Tests: alpine / musl-binary x64 (alpine 3.10, node v8.17.0) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.15, node v14.21.3) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.18, node v18.20.4) (push) Failing after 14m12s
Tests: alpine / musl-binary x64 (alpine 3.20, node v20.18.1) (push) Failing after 14m12s
Tests: fast / fast (sh, gawk) (push) Failing after 32s
Tests: installation_node / installation_node (bash, without curl) (push) Failing after 22m25s
Tests: installation_node / installation_node (zsh, without curl) (push) Failing after 1m56s
Tests: xenial / xenial (bash) (push) Failing after 24m1s
Tests: xenial / xenial (sh) (push) Failing after 1m32s
urchin tests / tests (dash, slow) (push) Failing after 7m21s
urchin tests / tests (sh, slow) (push) Failing after 2m34s
Tests: fast / fast (bash, mawk) (push) Failing after 3m17s
Tests: installation_node / installation_node (sh, without curl) (push) Failing after 32s
Tests: installation_node / installation_node (zsh) (push) Failing after 32s
Tests: xenial / xenial (zsh) (push) Failing after 1m33s
Tests: xenial / all xenial tests (push) Skipped
urchin tests / tests (bash, installation_iojs) (push) Failing after 1m51s
urchin tests / tests (zsh, installation_iojs) (push) Failing after 32s
urchin tests / tests (zsh, sourcing) (push) Failing after 34s
urchin tests / all test suites, all shells (push) Skipped
Tests: alpine / fast arm64 (alpine 3, dash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, dash) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3, node v22.21.1) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3, node v24.9.0) (push) Canceled after 0s
Tests: fast / fast (macOS, zsh) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, dash) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, zsh) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / tests, on windows (push) Canceled after 0s
Tests: `nvm install-latest-npm` / matrix (push) Failing after 3m40s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (push) Skipped
Tests: linting / all linting (push) Skipped
Tests: alpine / fast x64 (alpine 3, bash) (push) Failing after 32s
Tests: installation_iojs / actually compile io.js from source (gcc 4.9 container) (push) Failing after 31s
Tests: installation_iojs / all installation_iojs tests (push) Skipped
Tests: fast / fast (dash, mawk) (push) Successful in 16m45s
Tests: installation_iojs / installation_iojs without curl (bash) (push) Failing after 1m32s
Tests: installation_iojs / installation_iojs without curl (zsh) (push) Failing after 31s
urchin tests / tests (bash, slow) (push) Failing after 33s
urchin tests / tests (zsh, slow) (push) Failing after 32s
urchin tests / tests (sh, sourcing) (push) Failing after 1m34s
Tests: alpine / fast arm64 (alpine 3, sh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, zsh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, bash) (push) Canceled after 0s
Tests: alpine / all alpine tests (push) Canceled after 0s
Tests: fast / fast (macOS, sh) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, sh) (push) Canceled after 0s
Tests: fast / all fast tests (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine-3.23) (push) Canceled after 0s
Previously, every download was refused only after it was fetched, a verified cached archive was deleted as "broken", and the source fallback then downloaded a second archive that was refused the same way, with no message saying what to install. |
||
|
|
362f5e2c71 |
[Breaking] nvm_compare_checksum: refuse a file whose checksum cannot be verified
The empty-computed-sum branch ended with a bare `return`,
whose status is that of the preceding `nvm_err`, which is 0.
Callers treat 0 as "verified",
so an artifact that could not be verified was installed anyway,
and was even moved into the verified cache slot,
violating nvm.sh's own invariant that only a verified archive may sit at ${TARBALL}
(a later `--offline` install would then use it without any verification).
Return 1 so the artifact is rejected, as intended by #1858.
Fixes #1858
Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com>
Co-authored-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
|
||
|
|
015c4f1e3b |
[Fix] install-latest-npm: npm v12 is out
|
||
|
|
4e8758a801 |
v0.41.0
New Stuff - select versions by category: `alpha`, `lts`, `non-lts`, `iojs`; exclude alphas by default - `nvm alias`: store `--lts` and `--lts=<name>` - record every node version's LTS status - `nvm ls-remote`: annotate versions with the `node` alias and local aliases (#3920) - add `nvm_has_italics`, to detect terminal italics support via terminfo Bug Fixes - `nvm`: treat a bare `--only` like an empty `--only=` - `nvm_ls_remote`, `nvm_remote_version`: match dots between version components literally (#3982) - `nvm_nvmrc_invalid_msg`: respect `--silent` - `nvm_download`: pass `$NVM_AUTH_HEADER` to curl and GNU Wget in a config file, not as an argument - `nvm_ls_remote_index_tab`, `nvm_remote_version`, `nvm_ls_cached`: pass the version pattern to grep with `-e` - `nvm_die_on_prefix`: never let a project `.npmrc` choose which npmrc file `--delete-prefix` edits - `nvm_download_artifact`: only put an archive in the cache once its checksum has passed - `nvm_normalize_lts`, `nvm_ls_remote_index_tab`: keep untrusted text out of shell arithmetic and LTS aliases - `nvm install`: keep nvm options after the version out of `./configure` (#3981) - `nvm install`: apply `--alias`, `--default` and `--save` after every install (#3981) - `nvm install`: don't leave `NVM_NO_PROGRESS` set in the caller's shell - `nvm_get_default_packages`: ignore CRLF line endings (#3979) - `install.sh`: ignore commented-out profile source lines (#3860) - `nvm_print_implicit_alias`: keep `STABLE` bound, and `STABLE` and `UNSTABLE` independent of the caller (#3975) - `nvm_ls`: treat a version dir with only hidden entries as empty (#3974) - `ls`: list versions whose directory is a symlink (#3973) - `nvm_die_on_prefix`: check a nonexistent prefix on Windows (#3972) - `install.sh`: only write `$HOME` when `$NVM_DIR` is inside it (#3962) - `nvm_is_version_or_alias`: reject uppercase LTS names in every locale - `nvm_process_nvmrc`: don't show the content of a symlinked `.nvmrc` - `nvm_write_nvmrc`: don't write through a symlinked `.nvmrc` - `nvm_ls`: match `NVM_DIR` literally - `nvm use`: do not pile up `PATH` entries in nested sessions (#3959) - `nvm_filter_installed_versions`, `nvm_filter_lts_versions`, `nvm_record_lts_status`, `nvm_get_default_packages`: keep backslashes in `NVM_DIR` paths - `nvm_strip_path`: preserve literal backslashes in `NVM_DIR` (#3958) - `nvm_find_up`, `nvm_find_project_dir`: stop at a Windows drive root instead of looping forever (#3968) - `nvm_ls_cached`: match dots in the version literally, and ignore a trailing dot (#3961) - `install.sh`: `nvm_check_global_modules`: don't run a Windows npm under WSL (#3966) - `nvm`: ignore option variables set by the caller - `nvm reinstall-packages`: don't print `VERSION=''` in zsh - `nvm_alias`, `nvm_ls_remote_index_tab`, `nvm use`: return the exit code of a failed check - `nvm_print_versions`: don't mark `N/A` as installed - `nvm_ls`: no blank line before `system` when nothing is installed - `nvm_print_versions`: widen the version column for long versions - `nvm_ls`: match a prerelease only up to a `.` - `nvm_ls`: list every installed prerelease, in semver order - `nvm uninstall`: only remove aliases that point at the uninstalled version - `nvm_ls_cached`: only match whole version numbers - `nvm debug`: don't let the shell read stdin when asked for its version - `nvm_download`: with GNU Wget, follow only same-origin redirects when sending `$NVM_AUTH_HEADER` - `nvm_download`: only send `$NVM_AUTH_HEADER` to URLs under a mirror it applies to - `install.sh`: don't let a git repository in the current directory affect `git ls-remote` - `nvm_remote_versions`: only consult io.js's version list for majors 1 through 3 - `nvm_remote_versions`: place io.js versions by major version, not at the literal `v4.0.0` - `nvm.sh`: detect `NVM_DIR` without `$0`/`$_`; fall back to the default install location instead of the working directory - `nvm_process_nvmrc_content`: reject control characters - `nvm_download_artifact`, `nvm debug`: mask credentials in mirror URLs when printing them - `nvm_install_binary`, `nvm_install_source`: only use a tarball that `nvm_download_artifact` put in the cache - `nvm_download`, `nvm_get_latest`, `install.sh`: pass `-q` to curl first, so `.curlrc` is ignored again - `nvm_is_version_installed`: fail when `nvm_version_path` fails - `nvm use`, `nvm-exec`: stop option parsing at `--` - `nvm install`: validate an inherited `NVM_MAKE_JOBS` like `-j` - `nvm_is_natural_num`: reject anything but digits - `nvm_remote_version`: match the requested version as a whole version component - `install.sh`: a failed script-method download no longer clobbers the install or reports success - `nvm_ls`: match the version pattern literally - `bash_completion`: list alias and version names without expanding them - `nvm_sanitize_auth_header`: strip newlines, so wrapped `base64` credentials work - `nvm_cd`: bypass a user-defined `cd` function (#3836) - `nvm use`: handle regex-special characters in `$NVM_DIR` (#3939) - `install.sh`: start a new line before appending to a profile that does not end with one (#3952) - Handle filesystem identity when checking path containment (#3921) - `nvm alias`: do not drop output from background jobs on bash 3.2 - `nvm`: do not change or export the caller's `IFS` - `nvm install`: do not remove the caller's `TMPDIR` after a failed download - `nvm exec`/`nvm run`: do not treat filenames with digits as versions Refactors - `install.sh`: check profile lines through one comment-aware helper (#3976) Robustness - `nvm_nvmrc_invalid_msg`: only show an excerpt of the parsed content - `install.sh`, `nvm uninstall`: pass the version to grep with `-e` Performance - `nvm_print_implicit_alias`: classify implicit aliases in one awk pass (#3980) - `nvm_is_installed_exact_version`: also take the fast path for an exact prerelease - `nvm_version_greater`, `nvm_version_greater_than_or_equal_to`: avoid `awk` where possible (#3949) - `nvm_is_valid_version`, `nvm_validate_implicit_alias`: avoid forks (#3949) - `nvm_echo`: use the `printf` shell builtin under zsh (#3949) - `nvm_get_os`: read `/etc/os-release` instead of forking `uname -a` (#3949) - `nvm_npmrc_bad_news_bears`: scan npmrc files without forking `grep` (#3949) - `nvm_die_on_prefix`: detect the OS only when it is needed (#3949) - `nvm_version`: resolve an exact, installed version without `nvm_ls` (#3949) - `nvm_is_version_installed`: check the modern layout's path before the full lookup (#3949) - `nvm_resolve_local_alias`: skip `nvm_version` for an exact, installed version (#3937) - `nvm use`: skip re-resolving an exact, installed version (#3937) Docs - [readme] `cdnvm`: let nvm parse `.nvmrc`, so a symlinked `.nvmrc`'s content is not printed - [readme] Fix a Docker warning from using Docker installation instructions (#3927) - [readme] explain the misleading `npm install` error from `npm run test/fast` (#3944) Misc - [meta] `Makefile`: default `NVM_DIR` to the checkout when it is not set - [meta] `release-notes.sh`: replace control characters in commit subjects Tests - make fast tests pass as root, without `sudo`, and without a terminal - [actions] TOC: use `node/install` instead of `setup-node` - pin `--lts` and `node` installs to end-of-life lines, so a new node release can't break them - `bash_completion`: don't let zsh's `compinit` wait for an answer - [actions] `tests-alpine`: time out jobs well before GitHub's 6-hour limit - `nvm_download`: point the httpbin Authorization check at a configured mirror - `nvm_get_arch_unofficial`: set `NVM_DIR` when sourcing `nvm.sh` in the chroots - `nvm install v1 works`: get the version from `nvm_remote_version`, not the `ls-remote` display - [actions] cache container images, verified against digests looked up live - [actions] pull container images through Google's Docker Hub mirror - [actions] never let an apt install wait on a prompt - [actions] retry apt package installs through Ubuntu mirror outages - add unit coverage for `nvm_version_greater_than_or_equal_to` (#3942) - add unit tests for `nvm_version_greater_than_or_equal_to` (#3941) - `nvm install --reinstall-packages-from`: mock the remote version instead of fetching it - [actions] run the fast suite on macOS and WSL too - make the fast suite pass on macOS - [actions] rename `windows-npm` workflow to `windows-nvm`, since it tests `nvm install`v0.41.0 |
||
|
|
e1927f5096 |
[Tests] make fast tests pass as root, without sudo, and without a terminal
Six fast tests failed outside of CI's setup, which runs them as a non-root user with `sudo` and a terminal. `nvm_download_artifact error propagation` expected `mkdir -p` under `/nonexistent` to fail, which root can create; it now uses a path under a regular file, which nobody can create. `nvm_get_arch_unofficial` now only uses `sudo` when it is not already root, and skips the chroot checks when it can do neither. `nvm_write_nvmrc`'s permissions check and the `nvm uninstall` permissions test are skipped as root, since root ignores file permissions. `nvm_stdout_is_terminal`'s `/dev/tty` checks are skipped when there is no controlling terminal, as in `docker run` without `-t`. `nvm_process_nvmrc` now fails with a clear message when the `test/fixtures/nvmrc` submodule is not checked out, instead of on an unexpanded glob. This is not a vulnerability fix. |
||
|
|
c314f1cbb3 |
[readme] cdnvm: let nvm parse .nvmrc, so a symlinked .nvmrc's content is not printed
The bash `cdnvm` example read `.nvmrc` raw and passed its content to `nvm ls`, `nvm install`, and `nvm use`, so a `.nvmrc` symlinked to any readable file had that file's content printed in a "not found" error, bypassing the protection that `nvm_process_nvmrc` gives `nvm use`. It now gets the version from `nvm_process_nvmrc`, which refuses a symlinked `.nvmrc` that does not contain a version or alias without showing its content, and also strips comments, which the raw read passed along. |
||
|
|
d0ebdd3709 |
[Fix] nvm: treat a bare --only like an empty --only=
Every command that accepts `--only=<categories>` only recognized it with an `=`, so a bare `--only` got whatever an unknown argument gets, and no command said what was wrong with it. `nvm ls`, `nvm ls-remote`, `nvm exec`, `nvm alias`, and `nvm version-remote` rejected it as an unsupported option; `nvm uninstall` and `nvm reinstall-packages` printed their usage; `nvm use`, `nvm which`, `nvm run`, and `nvm version` took it, or the version after it, as the version to look for; and `nvm install --only 20` printed grep's usage, while `nvm install 20 --only` ignored it. A bare `--only` is now parsed as `--only=` with an empty value, so every command gives the same error for both: `--only` needs a comma-separated list of categories. Aliases already reject such a value when they are created, so stored alias targets need no change. |
||
|
|
ed2de88826 |
[Fix] nvm_ls_remote, nvm_remote_version: match dots between version components literally
The version pattern went to grep with its dots unescaped, so each one matched any character: `20.1` also matched `v2041.0.0`, and `20.1.1` matched `v20.111.1`, so `nvm_remote_version 20.1.1` resolved to `v20.111.1`. Escape each dot that is followed by a digit, keeping any other regex syntax in the pattern, like `v[68]`. |
||
|
|
699c898671 |
[Robustness] nvm_nvmrc_invalid_msg: only show an excerpt of the parsed content
Code scanning - action / CodeQL-Build (push) Failing after 1m43s
Tests: `nvm install-latest-npm` / matrix (push) Successful in 25s
Tests: linting / test_naming (push) Successful in 13s
Tests: nvm install with set -e / matrix (push) Successful in 8s
Tests: alpine / fast x64 (alpine 3.15, bash) (push) Failing after 5s
Tests: alpine / fast x64 (alpine 3, bash) (push) Failing after 1m51s
Tests: alpine / fast x64 (alpine 3.15, zsh) (push) Failing after 5s
Tests: alpine / fast x64 (alpine 3.19, dash) (push) Failing after 10s
Tests: alpine / fast x64 (alpine 3.19, zsh) (push) Failing after 1m43s
Tests: alpine / musl-binary x64 (alpine 3.10, node v10.24.1) (push) Failing after 28s
Tests: fast / fast (bash, gawk) (push) Failing after 17m39s
Tests: fast / fast (dash, mawk) (push) Failing after 2m58s
Tests: installation_iojs / installation_iojs without curl (dash) (push) Successful in 2m18s
Tests: installation_iojs / installation_iojs without curl (zsh) (push) Successful in 2m21s
Tests: fast / fast (zsh, gawk) (push) Failing after 7m38s
Tests: installation_node / installation_node (bash) (push) Failing after 1m21s
Tests: installation_node / installation_node (dash) (push) Failing after 24s
Tests: xenial / xenial (sh) (push) Failing after 1m13s
Tests: installation_iojs / actually compile io.js from source (gcc 4.9 container) (push) Failing after 53s
Tests: installation_node / installation_node (zsh) (push) Failing after 1m13s
urchin tests / tests (bash, slow) (push) Failing after 10m23s
urchin tests / tests (sh, slow) (push) Failing after 7m53s
urchin tests / tests (zsh, slow) (push) Failing after 8m6s
urchin tests / tests (zsh, sourcing) (push) Successful in 1m34s
urchin tests / all test suites, all shells (push) Skipped
update readme TOC / update readme TOC (push) Successful in 1m7s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (0.12) (push) Successful in 1m6s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (13) (push) Successful in 54s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (14.16) (push) Successful in 53s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (2) (push) Successful in 1m1s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (4.6) (push) Successful in 1m1s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (6) (push) Successful in 1m21s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (8) (push) Successful in 56s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (12) (push) Successful in 54s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (15) (push) Successful in 56s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (17) (push) Successful in 55s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (23) (push) Successful in 51s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (24) (push) Successful in 52s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (25) (push) Successful in 53s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (4.4) (push) Successful in 1m2s
Tests: nvm install with set -e / test (no nvmrc, v0.39.3, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.39.4, 1 shlvl) (push) Failing after 13s
Tests: nvm install with set -e / test (no nvmrc, v0.40.2, 1 shlvl) (push) Failing after 11s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (9.2) (push) Successful in 56s
Tests: linting / all linting (push) Successful in 1s
Tests: nvm install with set -e / test (no nvmrc, v0.39.4, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.39.6, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.40.0, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.1, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.40.8, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.8, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, HEAD, 1 shlvl) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.39.5, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.0, 2 shlvls) (push) Successful in 13s
Tests: nvm install with set -e / test (no nvmrc, v0.40.3, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (no nvmrc, v0.40.4, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.39.4, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.5, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.5, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.4, 2 shlvls) (push) Failing after 13s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (push) Successful in 2s
Tests on Windows: `nvm install` / MSYS fail prefix nvm install (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--default 12) (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--lts) (push) Canceled after 0s
Tests on Windows: `nvm install` / MSYS nvm install (--no-progress 10) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine-3.17) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3, dash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, sh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, zsh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, zsh) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3.20, node v20.20.1) (push) Canceled after 0s
Tests: fast / fast (macOS, bash) (push) Canceled after 0s
Tests: fast / fast (macOS, dash) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, sh) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, zsh) (push) Canceled after 0s
Tests: fast / all fast tests (push) Canceled after 0s
Tests: linting / dockerfile_lint (push) Successful in 1m15s
Tests: linting / check_exec (push) Successful in 1m19s
Tests: release process / release (push) Successful in 46s
Tests: shellcheck / shellcheck_matrix (bash_completion, bash) (push) Failing after 51s
Tests: alpine / fast x64 (alpine 3, dash) (push) Failing after 56s
Tests: alpine / fast x64 (alpine 3, sh) (push) Failing after 6s
Tests: shellcheck / shellcheck_matrix (nvm.sh, bash) (push) Failing after 52s
Tests: shellcheck / shellcheck_matrix (nvm.sh, ksh) (push) Failing after 51s
Tests: shellcheck / shellcheck_matrix (nvm.sh, sh) (push) Failing after 54s
Tests: shellcheck / shellcheck (push) Skipped
Tests: alpine / fast x64 (alpine 3.15, dash) (push) Failing after 16s
Tests: alpine / fast x64 (alpine 3.15, sh) (push) Failing after 5s
Tests: alpine / fast x64 (alpine 3.19, bash) (push) Failing after 23s
Tests: alpine / musl-binary x64 (alpine 3.12, node v12.22.12) (push) Failing after 31s
Tests: alpine / musl-binary x64 (alpine 3.18, node v18.20.4) (push) Failing after 27s
Tests: fast / fast (sh, mawk) (push) Failing after 2m44s
Tests: installation_iojs / installation_iojs without curl (sh) (push) Successful in 2m13s
Tests: alpine / musl-binary x64 (alpine 3.15, node v14.21.3) (push) Failing after 35s
Tests: alpine / musl-binary x64 (alpine 3.16, node v16.20.2) (push) Failing after 31s
Tests: alpine / musl-binary x64 (alpine 3.20, node v20.18.1) (push) Failing after 27s
Tests: fast / fast (dash, gawk) (push) Failing after 3m47s
Tests: fast / fast (sh, gawk) (push) Failing after 3m52s
Tests: fast / fast (zsh, mawk) (push) Failing after 3m50s
Tests: installation_iojs / all installation_iojs tests (push) Skipped
Tests: installation_node / installation_node (bash, without curl) (push) Failing after 1m13s
Tests: xenial / all xenial tests (push) Skipped
urchin tests / tests (bash, install_script) (push) Successful in 2m49s
Tests: installation_node / installation_node (sh) (push) Failing after 1m11s
Tests: installation_node / installation_node (zsh, without curl) (push) Failing after 1m12s
Tests: installation_node / all installation_node tests (push) Skipped
Tests: xenial / xenial (bash) (push) Failing after 1m11s
Tests: xenial / xenial (zsh) (push) Failing after 1m15s
urchin tests / tests (dash, installation_iojs) (push) Failing after 2m5s
urchin tests / tests (sh, sourcing) (push) Successful in 1m15s
urchin tests / tests (zsh, installation_iojs) (push) Failing after 2m2s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (0.10) (push) Successful in 1m3s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (1) (push) Successful in 1m5s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (11) (push) Successful in 54s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (14) (push) Successful in 56s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (19) (push) Successful in 54s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (20.4) (push) Successful in 53s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (7) (push) Successful in 1m13s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (16) (push) Successful in 55s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (20.5) (push) Successful in 50s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (26) (push) Successful in 51s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (3) (push) Successful in 1m3s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (4) (push) Successful in 1m2s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (5.9) (push) Successful in 1m1s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (9.1) (push) Successful in 56s
Tests: nvm install with set -e / test (no nvmrc, HEAD, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (no nvmrc, v0.40.2, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.3, 1 shlvl) (push) Failing after 10s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (9.0) (push) Successful in 55s
Tests: nvm install with set -e / test (no nvmrc, v0.39.5, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.39.7, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.40.0, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.7, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.39.7, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.40.1, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.2, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (no nvmrc, v0.40.5, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.6, 1 shlvl) (push) Failing after 13s
Tests: nvm install with set -e / test (nvmrc, HEAD, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.39.3, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.39.4, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.39.6, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.39.6, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.1, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.40.2, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.6, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.6, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.7, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.7, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.8, 2 shlvls) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.40.3, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (nvmrc, v0.40.4, 1 shlvl) (push) Failing after 11s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, --lts, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 10, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 21, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 12, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / tests, on windows (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3, bash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3, sh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3, zsh) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, bash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, bash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, dash) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.19, sh) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3, node v22.21.1) (push) Canceled after 0s
Tests: alpine / all alpine tests (push) Canceled after 0s
Tests: fast / fast (macOS, sh) (push) Canceled after 0s
Tests: fast / fast (macOS, zsh) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, dash) (push) Canceled after 0s
Tests: linting / eclint (push) Successful in 1m46s
Tests: linting / doctoc (push) Successful in 1m18s
Tests: alpine / fast x64 (alpine 3, zsh) (push) Failing after 5s
Tests: shellcheck / shellcheck_matrix (install.sh, bash) (push) Failing after 51s
Tests: shellcheck / shellcheck_matrix (nvm-exec, bash) (push) Failing after 50s
Tests: shellcheck / shellcheck_matrix (nvm.sh, dash) (push) Failing after 50s
Tests: alpine / fast x64 (alpine 3.19, sh) (push) Failing after 1m50s
Tests: alpine / musl-binary x64 (alpine 3, node v22.12.0) (push) Failing after 29s
Tests: alpine / musl-binary x64 (alpine 3.10, node v8.17.0) (push) Failing after 23s
Tests: fast / fast (bash, mawk) (push) Failing after 3m35s
Tests: installation_iojs / installation_iojs without curl (bash) (push) Successful in 2m17s
Tests: installation_node / installation_node (dash, without curl) (push) Failing after 1m20s
Tests: installation_node / installation_node (sh, without curl) (push) Failing after 1m11s
Tests: xenial / xenial (dash) (push) Failing after 1m11s
urchin tests / tests (bash, installation_iojs) (push) Failing after 1m51s
urchin tests / tests (dash, slow) (push) Failing after 8m17s
urchin tests / tests (bash, sourcing) (push) Successful in 1m40s
urchin tests / tests (dash, sourcing) (push) Successful in 1m15s
urchin tests / tests (sh, installation_iojs) (push) Failing after 1m45s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (10) (push) Successful in 54s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (14.17) (push) Successful in 56s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (18) (push) Successful in 52s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (20) (push) Successful in 51s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (21) (push) Successful in 52s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (22) (push) Successful in 52s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (4.5) (push) Successful in 1m1s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (5) (push) Successful in 1m6s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (6.1) (push) Successful in 1m7s
Tests: nvm install with set -e / test (no nvmrc, HEAD, 1 shlvl) (push) Failing after 13s
Tests: nvm install with set -e / test (no nvmrc, v0.39.3, 1 shlvl) (push) Failing after 10s
Tests: `nvm install-latest-npm` / nvm install-latest-npm (9) (push) Successful in 54s
Tests: nvm install with set -e / test (no nvmrc, v0.39.5, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.39.6, 2 shlvls) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.39.7, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.1, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.6, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.7, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.39.3, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.3, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / test (no nvmrc, v0.40.4, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (no nvmrc, v0.40.5, 2 shlvls) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.39.5, 1 shlvl) (push) Failing after 12s
Tests: nvm install with set -e / test (nvmrc, v0.39.7, 1 shlvl) (push) Failing after 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.0, 1 shlvl) (push) Successful in 10s
Tests: nvm install with set -e / test (nvmrc, v0.40.8, 1 shlvl) (push) Failing after 11s
Tests: nvm install with set -e / finisher (push) Skipped
Tests on Windows: `nvm install` / Cygwin nvm install (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 12, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 14, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 16, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Debian-12) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Ubuntu-18.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 14, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Debian-13) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 18, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-20.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Ubuntu-24.04) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 11, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (, 18, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, --lts, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 10, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 11, Alpine-3.23) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 16, Alpine-3.17) (push) Canceled after 0s
Tests on Windows: `nvm install` / WSL nvm install (script, 21, Alpine-3.23) (push) Canceled after 0s
Tests: alpine / fast arm64 (alpine 3.15, dash) (push) Canceled after 0s
Tests: alpine / musl-binary arm64 (alpine 3, node v24.9.0) (push) Canceled after 0s
Tests: fast / fast (WSL Ubuntu-24.04, bash) (push) Canceled after 0s
The invalid `.nvmrc` message printed all of the file's parsed content, so a large file that is not really an `.nvmrc` was printed in full. It now shows at most the first 10 lines, each cut to 100 characters, and marks anything left out with `[...]`; a real `.nvmrc` is well within those limits.
This is hardening, not a vulnerability fix: since
|
||
|
|
cfb33c84ed |
[Fix] nvm_nvmrc_invalid_msg: respect --silent
The invalid `.nvmrc` message, which includes the file's parsed content, was printed even when `NVM_SILENT` was set (eg, by `nvm use --silent`), unlike nvm's other `.nvmrc` messages. It is now suppressed there too; the exit status still reports the invalid file.
This is hardening, not a vulnerability fix: since
|
||
|
|
903e349369 |
[Fix] nvm_download: pass $NVM_AUTH_HEADER to curl and GNU Wget in a config file, not as an argument
The header was passed as a `--header` argument, so it was readable by anyone who could see the downloader's command line. curl now reads it as `header = "…"` from a config on stdin (`--config -`); the sanitized value can contain neither `"` nor `\` nor a line break, so it cannot escape the quoted string or add another option. GNU Wget only reads a config file that is a regular file, so a subshell writes the header to a `mktemp` file in `$TMPDIR` (mode 0600), after a copy of the user's `$WGETRC` or `~/.wgetrc`, which that file replaces, and points `WGETRC` at it; traps on EXIT, HUP, INT, and TERM remove it, and `WGETRC` never reaches the user's shell. BusyBox wget reads no config file and has no option for one, so it still gets the header as an argument; the README recommends curl on shared machines. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-540RL2U6. |
||
|
|
bce663e387 |
[Fix] nvm_ls_remote_index_tab, nvm_remote_version, nvm_ls_cached: pass the version pattern to grep with -e
The requested version pattern was passed to grep as a bare argument, so a pattern starting with `-` was parsed as grep options instead. That pattern can come from a `.nvmrc` in a repository the user cloned, or, for implicit aliases like `node` and `stable`, from the version column of the mirror's index.tab. A pattern like `-Rohenpm_[A-Za-z0-9]*` made GNU grep ignore the version list on stdin and search the current directory recursively, following symlinks, so a string from a local file (such as an npm token in a `.npmrc`) was taken as the "version", printed, and requested from the mirror in the download URLs; since the version list was never read, this also worked with `--offline`. Pass the pattern after `-e` in `nvm_ls_remote_index_tab` (which also covers `nvm_ls_remote`, `nvm_ls_remote_iojs`, and `nvm_remote_versions`), in the post-check in `nvm_remote_version`, and in `nvm_ls_cached`, so a leading `-` is just part of a pattern that matches no version. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-EN9DM7WC. |
||
|
|
4049296ca8 |
[Fix] nvm_die_on_prefix: never let a project .npmrc choose which npmrc file --delete-prefix edits
`nvm use --delete-prefix`, which nvm itself recommends when it finds a `prefix` or `globalconfig` setting, ran `npm config delete` from the current directory. For a project `.npmrc`, it ran a bare `npm config delete prefix`/`globalconfig`, so npm loaded that untrusted file first, and its `userconfig`, `globalconfig`, or `location=global` keys picked which file npm rewrote, deleted, or chmodded to 0666 - eg, `~/.bashrc` or `~/.aws/credentials`. The builtin and user branches pinned `--userconfig`, but still loaded the project file, so a project `location=global` plus an indented ` globalconfig=` (which nvm's check does not match) redirected those writes the same way. `npm config delete` never edits the project file anyway, so that branch could not do what it claimed. For the project npmrc, no longer run npm at all: with `--delete-prefix`, warn that project npmrc files are not modified and must be edited by hand, and continue, as before. For the builtin, global, and user npmrc files, pass `--prefix` set to the version directory, so npm does not walk up from the current directory to load the project npmrc, and its global config resolves to that version's `etc/npmrc`. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-WYRTKBQ5. |
||
|
|
1f99e4c20b |
[Fix] nvm_download_artifact: only put an archive in the cache once its checksum has passed
`nvm install --offline` installs whatever archive sits at the cache path without checking it again, which is only safe if everything nvm writes there has been verified. When a download failed its checksum, `nvm_download_artifact` removed only the empty `files` directory and left the rejected archive in `$NVM_DIR/.cache`, so a later `nvm install --offline` would install the very tarball the online install had just refused. An interrupted download was also left at the final cache name. Download to a temporary `.unverified` name instead, run the 404 and checksum checks on that file, and move it to the cache path only once the checksum has passed. Every failure path, including a checksum mismatch or a missing expected checksum, now removes the temporary file and the version's cache directory, so `--offline` no longer finds the version at all. The README's offline section now says that only verified downloads are cached and that `--offline` trusts the cache as-is. Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-7NCT51FE. |
||
|
|
aa0572b7c4 |
[Fix] nvm_normalize_lts, nvm_ls_remote_index_tab: keep untrusted text out of shell arithmetic and LTS aliases
`nvm_normalize_lts` matched `lts/-N` with a glob that only pins the first digit after `lts/-`, then evaluated the rest inside `$((N+1))`. bash and zsh evaluate a variable's contents as an arithmetic expression there, including command substitutions in array subscripts, so a name like `lts/-10*path[$(cmd)1]` ran `cmd`. Such a name reaches this function from `nvm alias`, `nvm use`, `nvm install`, and `.nvmrc`, and also from LTS alias files written from a mirror's `index.tab`, which are resolved whenever `lts/*` or that codename is used. The version column of a mirror's `index.tab` was used verbatim: printed by `nvm ls-remote` and `nvm version-remote`, matched against patterns, and stored as the target of `lts/*` codename aliases. A hostile or compromised mirror could thus persist such a payload into `$NVM_DIR/alias/lts/`, where it is replayed later by `nvm alias` and alias resolution without the mirror being involved, and could put terminal escape sequences on the user's screen. `nvm_normalize_lts` now takes everything after `lts/-` with parameter expansion and passes the name through unchanged unless it is all digits, before any arithmetic happens. `lts/-1` through `lts/-N`, and the error when there are not that many LTS lines, behave as before; malformed offsets like `lts/-1x` or `lts/-10+1` are now returned unchanged in every shell, instead of erroring in dash or being evaluated in bash and zsh. This also drops the `$?` check after the arithmetic, which could never fire. `nvm_ls_remote_index_tab` now skips the header and keeps only rows whose version is `vX.Y.Z`, optionally followed by a `-` prerelease suffix of letters, digits, `.` and `-`, before anything is printed, stored, or matched. The check runs on the raw column, before the `iojs-` prefix is added. Every row of the current nodejs.org, nodejs.org nightly, and iojs.org index files passes, including `rc`, `nightly`, and `v8-canary` versions. Discovered by Anthropic's OSS Scanner, as vulnerabilities ANT-2026-0GXXE91V and ANT-2026-31ZIEY85. |
||
|
|
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. |
||
|
|
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. |
||
|
|
00cc205d6f |
[Fix] nvm install: don't leave NVM_NO_PROGRESS set in the caller's shell
`nvm install` passed the progress setting to `nvm_install_binary` and `nvm_install_source` as a prefix assignment, which bash 3.2 in POSIX mode (macOS's `sh`) keeps after a function call returns, so one install left `NVM_NO_PROGRESS=0` set, and every later `nvm install --no-progress` was ignored. Set it as a local instead. |
||
|
|
17270cd532 |
[Perf] nvm_print_implicit_alias: classify implicit aliases in one awk pass
To resolve `stable` and `unstable`, `nvm_print_implicit_alias` started an awk process per installed minor version, plus another per pre-1.0 one to check its parity. Classify the whole list in a single awk pass instead, and skip it when there is nothing to classify. The results are unchanged. Refs #3416. Refs #3811. |
||
|
|
84b176d46d |
[Fix] nvm_get_default_packages: ignore CRLF line endings
A `default-packages` file saved with Windows line endings left a carriage return on every package name, and turned each blank line into a lone `\r` entry, so `npm install -g` was given `rimraf\r` and failed. Strip a trailing `\r` from each line before parsing it, like `.nvmrc` parsing already tolerates. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Wei-Lun Li <b84330808@gmail.com> |
||
|
|
edde7ce995 |
[Refactor] install.sh: check profile lines through one comment-aware helper
`nvm_do_install` checked for its `nvm.sh` and `bash_completion` source lines with two separate regexes that each had to skip commented-out lines. Move that into `nvm_profile_has_line`, which strips whole-line comments before matching, and test the `bash_completion` line and an already set up profile too. |
||
|
|
db03e5e1c3 |
[Fix] install.sh: ignore commented-out profile source lines
`nvm_do_install` decided whether the profile already loads nvm, and its bash completion, by grepping for `/nvm.sh` and `$NVM_DIR/bash_completion` anywhere in it, so a commented-out line, the usual way to disable nvm, counted as present, and reinstalling left the shell with no nvm. Only count a line whose first non-blank character isn't `#`. Fixes #1889. Signed-off-by: Vaibhav Cheruvu <vaibhavsharma.c@gmail.com> Co-authored-by: Vaibhav Cheruvu <vaibhavsharma.c@gmail.com> Co-authored-by: Jordan Harband <ljharb@gmail.com> |
||
|
|
7ab48a653b |
[Fix] nvm_print_implicit_alias: keep STABLE bound, and STABLE and UNSTABLE independent of the caller
`STABLE` is only assigned inside the loop over `LAST_TWO`,
but it is echoed unconditionally afterwards.
With nothing installed, or with only an odd minor,
the loop never runs, so under `set -u` `nvm ls` dies on
`STABLE: unbound variable` instead of resolving `stable` to nothing.
`local STABLE` without an initializer also keeps the caller's value in sh and dash,
so `STABLE=x nvm ls stable` resolves the alias to something that isn't installed.
Initializing it where it is declared fixes both,
the way
|
||
|
|
c8dc8c9b1c |
[Fix] nvm_ls: treat a version dir with only hidden entries as empty
`nvm_ls` decides whether a version dir is worth searching with `ls -1qA`, which
also counts dotfiles, but then collects versions with `find "${DIR}"/*`, which
never matches them. A dir holding nothing but hidden entries passes the guard,
so when `nullglob` is not set `find` is handed the literal `*` and `nvm ls`
prints "No such file or directory" to stderr.
Drop `-A` from the guard so both halves agree on what counts as an entry.
Fixes #3727.
|
||
|
|
c6bf252f7d |
[Fix] ls: list versions whose directory is a symlink
nvm_ls collects installed versions with `find <dirs>/* -name . -o -type d -prune -o -path ...`, and `-type d` is false for a symlink, so a version dir that links to another volume was skipped from the listing entirely - while `nvm version`, `nvm which` and `nvm use` all kept working on it. Have that find follow symlinks, which makes linked-in versions visible and still ignores a broken link. Fixes #617. |
||
|
|
970ed9ea18 |
[Fix] nvm_die_on_prefix: check a nonexistent prefix on Windows
On Windows, `npm_config_prefix` is resolved with `cd` + `pwd` so it can be compared with `$NVM_DIR`. When the directory does not exist yet, that resolution fails, the value becomes empty, and the check is skipped. Keep the value as given in that case, like on other systems. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Wei-Lun Li <b84330808@gmail.com> |
||
|
|
c7a1b344da |
[Fix] install.sh: only write $HOME when $NVM_DIR is inside it
The profile line was built by replacing a leading `$HOME` with `sed`, without a path boundary, and with `$HOME` treated as a regex. With `HOME=/home/me` and `NVM_DIR=/home/me2/nvm`, or with `HOME=/` and `NVM_DIR=/usr/local/nvm`, the profile got `export NVM_DIR="$HOME2/nvm"` or `export NVM_DIR="$HOMEusr/local/nvm"`, which expand to the wrong directory, so nvm does not load in new shells. A `.` in `$HOME` matched any character, a `:` in it broke the `sed` expression, and a trailing slash on it left `$HOME.nvm`. Match `$HOME` literally, as a whole path component, and leave the path absolute when `$HOME` is empty. |
||
|
|
93da6595ce |
[Fix] nvm_is_version_or_alias: reject uppercase LTS names in every locale
bash 3.2, macOS's `/bin/sh`, matches a bracket range like `[a-z]` by collation order in a UTF-8 locale, which interleaves upper- and lowercase letters, so `lts/Iron` from a symlinked `.nvmrc` was accepted there. Match with `[:lower:]` instead. |
||
|
|
67268ebcb6 |
[Fix] nvm_process_nvmrc: don't show the content of a symlinked .nvmrc
`.nvmrc` is found and read through symlinks, so a repository that commits `.nvmrc` as a symlink to a path outside itself (eg, `../../.npmrc`) made a plain `nvm use`, `nvm install`, or `nvm which` (or `nvm-exec`, or the README's auto-switching shell hook) print that file: the invalid `.nvmrc` message shows everything that was parsed, even with `--silent`, and a one-line file was taken as the version, which is printed in the "Found" message and in later errors. A symlinked `.nvmrc` is still followed, so linking to another version file (eg, `.node-version`, or a parent directory's `.nvmrc`) keeps working, but its content is never shown, and it is valid only if it names a version or an existing alias, via a new `nvm_is_version_or_alias` helper. |
||
|
|
3f8411e58d |
[Fix] nvm_write_nvmrc: don't write through a symlinked .nvmrc
`nvm use --save` and `nvm install --save` wrote the version to `$PWD/.nvmrc` with `tee`, which follows a symlink, so a repository that commits `.nvmrc` as a symlink to a path outside itself made `--save` truncate any file the user can write (eg, a shell startup file or `~/.ssh/authorized_keys`) and replace it with the version string, or create the target of a dangling link. The link itself was left in place, so `git status` stayed clean. `nvm_write_nvmrc` now refuses, with a warning, when `.nvmrc` in the current directory is a symlink, dangling or not. |