This article will describe a procedure on how to install Node.js and the nvm on Ubuntu 20.04 LTS Focal Fossa

In this tutorial you will learn:
  • How to install default Node.js
  • How to check Node.js version
  • How to install NVM from source
  • How to any Node.js version per user basis
Installation of Node.js and NVM on Ubuntu 20.04 LTS Focal Fossa
Installation of Node.js and NVM on Ubuntu 20.04 LTS Focal Fossa

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed or upgraded Ubuntu 20.04 Focal Fossa
Software NVM, Node.js
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Install Node.js on Ubuntu 20.04 LTS Focal Fossa step by step instructions

Install stable Node.js from Ubuntu respository

The recommended way to install Node.js on your Ubuntu 20.04 LTS Focal Fossa is by using the apt command to install the stable default Node.js version from a standard Ubuntu repository:
$ sudo apt install nodejs
Once installed, check the Node.js version:
$ node --version
v10.15.2

SUBSCRIBE TO NEWSLETTER
Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.


Install any Node.js version from source

Take the following steps to install any Node.js version on your Ubuntu 20.04 system on per user basis.

  1. As a regular user first install NVM manager:
    $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
    
  2. Update your shell environment:
    $ source ~/.profile
    
  3. Check the NVM availablity by checking for its version:
    $ nvm --version
    0.33.8
    


  4. Next, list all available Node.js versions:
    $ nvm ls-remote
    ...
           v12.13.0   (LTS: Erbium)
           v12.13.1   (Latest LTS: Erbium)
            v13.0.0
            v13.0.1
            v13.1.0
    ->      v13.2.0
    
  5. Select and take a note of the Node.js version number your wish to install. Once ready execute the following command to install any desired version. For example:
    $ nvm install 13.2.0
    
  6. Check for install Node.js version:
    $ node -v
    v13.2.0
    
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.