Installing Node.js using NVM

1. Download the nvm installation script from GitHub pagearrow-up-right by using curl

curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh

2. Run the script with bash

bash install_nvm.sh

3. Restart your terminal

source ~/.profile
  • Source the ~/.profile file to gain access to the nvm functionality

  • or you can just logout & login

4. Check the versions of Node.js that are available

$ nvm ls-remote

      ...

        v12.0.0
        v12.1.0
        v12.2.0
        v12.3.0
        v12.3.1
        v12.4.0
        v12.5.0
        v12.6.0
        v12.7.0
        v12.8.0
        v12.8.1
        v12.9.0
        v12.9.1
       v12.10.0
       v12.11.0
       v12.11.1
       v12.12.0
       v12.13.0   (LTS: Erbium)
       v12.13.1   (LTS: Erbium)
       v12.14.0   (LTS: Erbium)
       v12.14.1   (LTS: Erbium)
       v12.15.0   (LTS: Erbium)
       v12.16.0   (LTS: Erbium)
       v12.16.1   (LTS: Erbium)
       v12.16.2   (LTS: Erbium)
       v12.16.3   (Latest LTS: Erbium)

        ...

5. Install

Install specific version

Install the most recent LTS release

6. See the version currently being used by the shell

or

7. If you have multiple Node.js versions, you can see what is installed

8. Switch Node.js versions

Switch to Node.js version 12.14.0

Switch to the latest Node.js version

Switch to the latest LTS version

9. Set the default version of node when starting a new shell

Specific version

Latest Node.js version

+

Uninstall Node.js

Last updated