Step 1-: Update System.
sudo apt update
sudo apt -y upgrade
Step 2-: Uninstall Previous Node.js
sudo apt-get remove nodejs
sudo apt-get remove npm
Step 3-: Add Node.js 12 APT repository
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Step 4-: Install Node.js 12 on Ubuntu 20.04
sudo apt -y install nodejs
Step 5-: Verify Node version
$ node --version
v12.10.0