Skip to content
Myr

v0.40.4

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jordan Harband · committed by Jordan Harband · parent 44e2590 · Browse files · 4 files+19 added−19 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+19 added−19 removed

  • other:+19 added−19 removed

4 files+19 added−19 removed

modified:install.sh+1 added-1 removed
31 unmodified lines
32 fi33}3435nvm_latest_version() {36 nvm_echo "v0.40.3"36 nvm_echo "v0.40.4"37}3839nvm_profile_is_bash_or_zsh() {40 local TEST_PROFILE
458 unmodified lines
modified:nvm.sh+1 added-1 removed
4495 unmodified lines
4496 esac4497 NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}"4498 ;;4499 "--version" | "-v")4500 nvm_echo '0.40.3'4500 nvm_echo '0.40.4'4501 ;;4502 "unload")4503 nvm deactivate >/dev/null 2>&14504 unset -f nvm \
216 unmodified lines
modified:package.json+1 added-1 removed
modified:README.md+16 added-16 removed
4 unmodified lines
5 </picture>6</a>789# 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.3-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684)9# 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.4-yellow.svg)][4] [![CII Best Practices](https://bestpractices.dev/projects/684/badge)](https://bestpractices.dev/projects/684)1011<!-- To update this table of contents, ensure you have run `npm install` then `npm run doctoc` -->12<!-- START doctoc generated TOC please keep comment here to allow auto update -->13<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
89 unmodified lines
103### Install & Update Script104105To **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 or Wget command:106```sh107curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash107curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash108```109```sh110wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash110wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash111```112113Running 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.114
18 unmodified lines
133Eg: `curl ... | NVM_DIR="path/to/nvm"`. Ensure that the `NVM_DIR` does not contain a trailing slash.134135- The installer can use `git`, `curl`, or `wget` to download `nvm`, whichever is available.136137- 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.3/install.sh | bash'`137- 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.4/install.sh | bash'`138139#### Installing in Docker140141When invoking bash as a non-interactive shell, like in a Docker container, none of the regular profile files are sourced. In order to use `nvm`, `node`, and `npm` like normal, you can instead specify the special `BASH_ENV` variable, which bash sources when invoked non-interactively.
7 unmodified lines
149RUN touch "${BASH_ENV}"150RUN echo '. "${BASH_ENV}"' >> ~/.bashrc151152# Download and install nvm153RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | PROFILE="${BASH_ENV}" bash153RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | PROFILE="${BASH_ENV}" bash154RUN echo node > .nvmrc155RUN nvm install156```157
9 unmodified lines
167# install curl168RUN apt update && apt install curl -y169170# install nvm171RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash171RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash172173# set env174ENV NVM_DIR=/root/.nvm175
17 unmodified lines
193```194docker run --rm -it nvmimage195196root@0a6b5a237c14:/# nvm -v1970.40.31970.40.4198199root@0a6b5a237c14:/# node -v200v19.9.0201
54 unmodified lines
256257```yaml258- name: Install nvm259 ansible.builtin.shell: >260 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash260 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash261 args:262 creates: "{{ ansible_env.HOME }}/.nvm/nvm.sh"263```264
53 unmodified lines
318If you have `git` installed (requires git v1.7.10+):3193201. clone this repo in the root of your user profile321 - `cd ~/` from anywhere then `git clone https://github.com/nvm-sh/nvm.git .nvm`3221. `cd ~/.nvm` and check out the latest version with `git checkout v0.40.3`3221. `cd ~/.nvm` and check out the latest version with `git checkout v0.40.4`3231. activate `nvm` by sourcing it from your shell: `. ./nvm.sh`324325Now add these lines to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file to have it automatically sourced upon login:326(you may have to add to more than one of the above files)
600 unmodified lines
927928### Alpine Linux 3.13+929```sh930apk add -U curl bash ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils931curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash931curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash932```933934### Alpine Linux 3.5 - 3.12935```sh936apk add -U curl bash ca-certificates openssl ncurses coreutils python2 make gcc g++ libgcc linux-headers grep util-linux binutils findutils937curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash937curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash938```939940_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` 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._941
94 unmodified lines
10361037To change the user directory and/or account name follow the instructions [here](https://support.apple.com/en-us/HT201548)10381039[1]: https://github.com/nvm-sh/nvm.git1040[2]: https://github.com/nvm-sh/nvm/blob/v0.40.3/install.sh1040[2]: https://github.com/nvm-sh/nvm/blob/v0.40.4/install.sh1041[3]: https://github.com/nvm-sh/nvm/actions/workflows/tests-fast.yml1042[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.31042[4]: https://github.com/nvm-sh/nvm/releases/tag/v0.40.41043[Urchin]: https://git.sdf.org/tlevine/urchin1044[Fish]: https://fishshell.com10451046**Homebrew makes zsh directories insecure**
49 unmodified lines
1096 There's a bug in recent versions of Apple's system `clang` compiler.1097 If one of these broken versions is installed on your system, the above step will likely still succeed even if you didn't include the `--shared-zlib` flag.1098 However, later, when you attempt to `npm install` something using your old version of node.js, you will see `incorrect data check` errors.1099 If you want to avoid the possible hassle of dealing with this, include that flag.1100 For more details, see [this issue](https://github.com/nodejs/node/issues/39313) and [this comment](https://github.com/nodejs/node/issues/39313#issuecomment-90.40.376)1100 For more details, see [this issue](https://github.com/nodejs/node/issues/39313) and [this comment](https://github.com/nodejs/node/issues/39313#issuecomment-90.40.476)11011102- Exit back to your native shell.11031104 ```sh
18 unmodified lines
11231124If you've encountered this error on WSL-2:11251126 ```sh1127 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash1127 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash1128 % Total % Received % Xferd Average Speed Time Time Time Current1129 Dload Upload Total Spent Left Speed1130 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0curl: (6) Could not resolve host: raw.githubusercontent.com1131 ```
26 unmodified lines
1158Currently, the sole maintainer is [@ljharb](https://github.com/ljharb) - more maintainers are quite welcome, and we hope to add folks to the team over time. [Governance](./GOVERNANCE.md) will be re-evaluated as the project evolves.11591160## Project Support11611162Only the latest version (v0.40.3 at this time) is supported.1162Only the latest version (v0.40.4 at this time) is supported.11631164## Enterprise Support11651166If you are unable to update to the latest version of `nvm`, our [partners](https://openjsf.org/ecosystem-sustainability-program) provide commercial security fixes for all unsupported versions:
11 unmodified lines