Install Node.js on Ubuntu 20.04 LTS Focal Fossa step-by-step instructions
Install stable Node.js from Ubuntu repository
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 the standard Ubuntu repository:
$ sudo apt install nodejs
Once installed, check the Node.js version:
$ node --version v10.15.2
Install any Node.js version from the source
Take the following steps to install any Node.js version on your Ubuntu 20.04 system per user basis.
- As a regular user first the install NVM manager:
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
- Update your shell environment:
$ source ~/.profile
- Check the NVM availability by checking for its version:
$ nvm --version 0.33.
- 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
- Select and take note of the Node.js version number you wish to install. Once ready execute the following command to install any desired version. For example:
$ nvm install 13.2.0
- Check for installed Node.js version:
$ node -v v13.2.0