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`
This commit is contained in:
Jordan Harband committed 2026-11-04 15:14:05 -06:00
1 parent e1927f5096
commit 43d410caa6
4 files changed
+18 -18

No files matched your search

+15 -15
View File
@@ -6,7 +6,7 @@
</a>
# Node Version Manager [![Tests](https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml/badge.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.40.8-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684)
# Node Version Manager [![Tests](https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml/badge.svg?branch=master)][3] [![nvm version](https://img.shields.io/badge/version-v0.41.0-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684)
<!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
@@ -108,10 +108,10 @@ nvm is a version manager for [node.js](https://nodejs.org/en/), designed to be i
To **install** or **update** nvm, you should run the [install script][2]. To do that, you may either download and run the script manually, or use the following [cURL](https://curl.se) or [Wget](https://www.gnu.org/software/wget/) command:
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
```
```sh
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
```
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to `~/.nvm`, and attempts to add the source lines from the snippet below to the correct profile file (`~/.bashrc`, `~/.bash_profile`, `~/.zshrc`, or `~/.profile`). If you find the install script is updating the wrong profile file, set the `$PROFILE` env var to the profile file’s path, and then rerun the installation script.
@@ -138,7 +138,7 @@ Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not conta
- The installer can use [`git`](https://git-scm.com/), `curl`, or `wget` to download `nvm`, whichever is available.
- You can instruct the installer to not edit your shell config (for example if you already get completions via a [zsh nvm plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm)) by setting `PROFILE=/dev/null` before running the `install.sh` script. Here's an example one-line command to do that: `PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash'`
- You can instruct the installer to not edit your shell config (for example if you already get completions via a [zsh nvm plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/nvm)) by setting `PROFILE=/dev/null` before running the `install.sh` script. Here's an example one-line command to do that: `PROFILE=/dev/null bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash'`
#### Installing in Docker
@@ -154,7 +154,7 @@ RUN touch "${BASH_ENV}"
RUN echo '. "${BASH_ENV}"' >> ~/.bashrc
# Download and install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | PROFILE="${BASH_ENV}" bash
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | PROFILE="${BASH_ENV}" bash
RUN echo node > .nvmrc
RUN nvm install
```
@@ -172,7 +172,7 @@ ARG NODE_VERSION=20
RUN apt update && apt install curl -y
# install nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
# set env
ENV NVM_DIR="${HOME:-/root}/.nvm"
@@ -198,7 +198,7 @@ After creation of the image you can start container interactively and run comman
docker run --rm -it nvmimage
root@0a6b5a237c14:/# nvm -v
0.40.8
0.41.0
root@0a6b5a237c14:/# node -v
v19.9.0
@@ -261,7 +261,7 @@ You can use a task:
```yaml
- name: Install nvm
ansible.builtin.shell: >
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
args:
creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"
```
@@ -323,7 +323,7 @@ If you have `git` installed (requires git v1.7.10+):
1. clone this repo in the root of your user profile
- `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`
1. `cd ~/.nvm` and check out the latest version with `git checkout v0.40.8`
1. `cd ~/.nvm` and check out the latest version with `git checkout v0.41.0`
1. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`
Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:
@@ -1051,13 +1051,13 @@ If installing nvm on Alpine Linux *is* still what you want or need to do, you sh
### Alpine Linux 3.13+
```sh
apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
```
### Alpine Linux 3.5 - 3.12
```sh
apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
```
_Note: Alpine 3.5 can only install NodeJS versions up to v6.9.5, Alpine 3.6 can only install versions up to v6.10.3, Alpine 3.7 installs versions up to v8.9.3, Alpine 3.8 installs versions up to v8.14.0, Alpine 3.9 installs versions up to v10.19.0, Alpine 3.10 installs versions up to v10.24.1, Alpine 3.11 installs versions up to v12.22.6, Alpine 3.12 installs versions up to v12.22.12, Alpine 3.13 & 3.14 install versions up to v14.20.0, Alpine 3.15 & 3.16 install versions up to v16.16.0 (**These are all versions on the main branch**). Alpine 3.5 - 3.12 required the package [`python2`](https://www.python.org/) to build NodeJS, as they are older versions to build. Alpine 3.13+ requires `python3` to successfully build newer NodeJS versions, but you can use `python2` with Alpine 3.13+ if you need to build versions of node supported in Alpine 3.5 - 3.15, you just need to specify what version of NodeJS you need to install in the package install script._
@@ -1157,9 +1157,9 @@ You have to make sure that the user directory name in `$HOME` and the user direc
To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)
[1]: https://github.com/nvm-sh/nvm.git
[2]: https://github.com/nvm-sh/nvm/blob/v0.40.8/install.sh
[2]: https://github.com/nvm-sh/nvm/blob/v0.41.0/install.sh
[3]: https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.8
[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.41.0
[Urchin]: https://git.sdf.org/tlevine/urchin
[Fish]: https://fishshell.com
@@ -1244,7 +1244,7 @@ Now you should be able to use node as usual.
If you've encountered this error on WSL-2:
```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.41.0/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com
@@ -1279,7 +1279,7 @@ Currently, the sole maintainer is [@ljharb](https://github.com/ljharb) - more ma
## Project Support
Only the latest version (v0.40.8 at this time) is supported.
Only the latest version (v0.41.0 at this time) is supported.
## Enterprise Support
+1 -1
View File
@@ -45,7 +45,7 @@ nvm_install_dir() {
}
nvm_latest_version() {
nvm_echo "v0.40.8"
nvm_echo "v0.41.0"
}
nvm_profile_has_line() {
+1 -1
View File
@@ -6665,7 +6665,7 @@ nvm() {
NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}"
;;
"--version" | "-v")
nvm_echo '0.40.8'
nvm_echo '0.41.0'
;;
"unload")
nvm deactivate >/dev/null 2>&1
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "nvm",
"version": "0.40.8",
"version": "0.41.0",
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
"directories": {
"test": "test"