linkInstalling Node.js On Ubuntu 20.04

There are several ways to install Node and npm on Ubuntu and it can be found here. I prefer using the third option which was using the Node Version Manager. Complete instructions for NVM can be found here.

linkInstall and update script

Run either one of these commands:

1link$curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

2link$

3link$wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

linkSource your shell

Depending on the shell you are using, run of these commands:

1link$source ~/.bashrc # --> bash

2link$source ~/.zshrc # --> zsh

3link$. ~/.profile # --> ksh

linkTesting

1link$nvm -v

0.39.0 # --> or whatever the latest version is

linkInstalling Node.js and npm

List the available versions

1link$nvm list-remote

... v15.14.0 v16.0.0 v16.1.0 v16.2.0

Select your desired version

1link$nvm install v16.2.0

Check your Node.js and npm versions

1link$node -v

v16.2.0
2link$npm -v

0.39.0