1. Linux

1.1. Installation

  • Find latest version from https://endoflife.date/nvm.

  • Enter the following commands at a Command Line.

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
    => Downloading nvm from git to '/home/delta/.nvm'
    => Cloning into '/home/delta/.nvm'...
    remote: Enumerating objects: 403, done.
    remote: Counting objects: 100% (403/403), done.
    remote: Compressing objects: 100% (332/332), done.
    remote: Total 403 (delta 56), reused 168 (delta 43), pack-reused 0 (from 0)
    Receiving objects: 100% (403/403), 404.19 KiB | 3.92 MiB/s, done.
    Resolving deltas: 100% (56/56), done.
    * (HEAD detached at FETCH_HEAD)
      master
    => Compressing and cleaning up git repository
    
    => Appending nvm source string to /home/delta/.bashrc
    => Appending bash_completion source string to /home/delta/.bashrc
    => Close and reopen your terminal to start using nvm or run the following to use it now:
    
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
  • Log out and log in again.

  • Enter the following commands at a Command Line.

    nvm --version                           # 0.40.4
    echo $NVM_DIR                           # /home/delta/.nvm
    ls -al ~/.nvm
    diff ~/.bashrc.org ~/.bashrc
    >
    > export NVM_DIR="$HOME/.nvm"
    > [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
    > [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

1.2. Uninstallation

  • See https://www.browserstack.com/guide/uninstall-nvm.

  • Enter the following commands at a Command Line.

     # Remove the NVM directory in your home directory.
    rm -rf ~/.nvm
    
    # Remove NVM configuration lines from bash profile files such as ~/.bashrc, .~/.bash_profile, and ~/.profile.
    sed -i "/NVM/d" ~/.bashrc

2. Windows

2.1. Installation

  • Download the installer from https://github.com/coreybutler/nvm-windows.

  • Run the nvm-setup.exe file with standard user privileges.

  • Click Next.

  • Choose I accept the agreement.

  • Click Next.

    C:\Users\Administrator\AppData\Roaming\nvm
  • Click Next.

    C:\Program Files\nodejs
  • Click Next.

  • Click Install.

  • Click Finish.

  • Enter the following commands at a Command Line.

    where node nodejs npm npx nvm
    nvm --version                           # 1.2.2
    nvm root                                # Current Root: C:\Users\Douwe\AppData\Local\nvm

3. Usage

nvm list
nvm install --lts
nvm list
nvm use --lts
nvm

node --version                          # v24.13.1
npm --version                           # 11.8.0