New Stuff
- select versions by category:
alpha,lts,non-lts,iojs; exclude alphas by default nvm alias: store--ltsand--lts=<name>- record every node version's LTS status
nvm ls-remote: annotate versions with thenodealias and local aliases (#3920)- add
nvm_has_italics, to detect terminal italics support via terminfo
Bug Fixes
nvm: treat a bare--onlylike an empty--only=nvm_ls_remote,nvm_remote_version: match dots between version components literally (#3982)nvm_nvmrc_invalid_msg: respect--silentnvm_download: pass$NVM_AUTH_HEADERto curl and GNU Wget in a config file, not as an argumentnvm_ls_remote_index_tab,nvm_remote_version,nvm_ls_cached: pass the version pattern to grep with-envm_die_on_prefix: never let a project.npmrcchoose which npmrc file--delete-prefixeditsnvm_download_artifact: only put an archive in the cache once its checksum has passednvm_normalize_lts,nvm_ls_remote_index_tab: keep untrusted text out of shell arithmetic and LTS aliasesnvm install: keep nvm options after the version out of./configure(#3981)nvm install: apply--alias,--defaultand--saveafter every install (#3981)nvm install: don't leaveNVM_NO_PROGRESSset in the caller's shellnvm_get_default_packages: ignore CRLF line endings (#3979)install.sh: ignore commented-out profile source lines (#3860)nvm_print_implicit_alias: keepSTABLEbound, andSTABLEandUNSTABLEindependent 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$HOMEwhen$NVM_DIRis inside it (#3962)nvm_is_version_or_alias: reject uppercase LTS names in every localenvm_process_nvmrc: don't show the content of a symlinked.nvmrcnvm_write_nvmrc: don't write through a symlinked.nvmrcnvm_ls: matchNVM_DIRliterallynvm use: do not pile upPATHentries in nested sessions (#3959)nvm_filter_installed_versions,nvm_filter_lts_versions,nvm_record_lts_status,nvm_get_default_packages: keep backslashes inNVM_DIRpathsnvm_strip_path: preserve literal backslashes inNVM_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 callernvm reinstall-packages: don't printVERSION=''in zshnvm_alias,nvm_ls_remote_index_tab,nvm use: return the exit code of a failed checknvm_print_versions: don't markN/Aas installednvm_ls: no blank line beforesystemwhen nothing is installednvm_print_versions: widen the version column for long versionsnvm_ls: match a prerelease only up to a.nvm_ls: list every installed prerelease, in semver ordernvm uninstall: only remove aliases that point at the uninstalled versionnvm_ls_cached: only match whole version numbersnvm debug: don't let the shell read stdin when asked for its versionnvm_download: with GNU Wget, follow only same-origin redirects when sending$NVM_AUTH_HEADERnvm_download: only send$NVM_AUTH_HEADERto URLs under a mirror it applies toinstall.sh: don't let a git repository in the current directory affectgit ls-remotenvm_remote_versions: only consult io.js's version list for majors 1 through 3nvm_remote_versions: place io.js versions by major version, not at the literalv4.0.0nvm.sh: detectNVM_DIRwithout$0/$_; fall back to the default install location instead of the working directorynvm_process_nvmrc_content: reject control charactersnvm_download_artifact,nvm debug: mask credentials in mirror URLs when printing themnvm_install_binary,nvm_install_source: only use a tarball thatnvm_download_artifactput in the cachenvm_download,nvm_get_latest,install.sh: pass-qto curl first, so.curlrcis ignored againnvm_is_version_installed: fail whennvm_version_pathfailsnvm use,nvm-exec: stop option parsing at--nvm install: validate an inheritedNVM_MAKE_JOBSlike-jnvm_is_natural_num: reject anything but digitsnvm_remote_version: match the requested version as a whole version componentinstall.sh: a failed script-method download no longer clobbers the install or reports successnvm_ls: match the version pattern literallybash_completion: list alias and version names without expanding themnvm_sanitize_auth_header: strip newlines, so wrappedbase64credentials worknvm_cd: bypass a user-definedcdfunction (#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.2nvm: do not change or export the caller'sIFSnvm install: do not remove the caller'sTMPDIRafter a failed downloadnvm 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 contentinstall.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 prereleasenvm_version_greater,nvm_version_greater_than_or_equal_to: avoidawkwhere possible (#3949)nvm_is_valid_version,nvm_validate_implicit_alias: avoid forks (#3949)nvm_echo: use theprintfshell builtin under zsh (#3949)nvm_get_os: read/etc/os-releaseinstead of forkinguname -a(#3949)nvm_npmrc_bad_news_bears: scan npmrc files without forkinggrep(#3949)nvm_die_on_prefix: detect the OS only when it is needed (#3949)nvm_version: resolve an exact, installed version withoutnvm_ls(#3949)nvm_is_version_installed: check the modern layout's path before the full lookup (#3949)nvm_resolve_local_alias: skipnvm_versionfor 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 installerror fromnpm run test/fast(#3944)
Misc
- [meta]
Makefile: defaultNVM_DIRto 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/installinstead ofsetup-node - pin
--ltsandnodeinstalls to end-of-life lines, so a new node release can't break them bash_completion: don't let zsh'scompinitwait 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 mirrornvm_get_arch_unofficial: setNVM_DIRwhen sourcingnvm.shin the chrootsnvm install v1 works: get the version fromnvm_remote_version, not thels-remotedisplay- [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-npmworkflow towindows-nvm, since it testsnvm install