Upgrade Node.JS to Latest LTS Version on Ubuntu And you no need to Remove or Purge the Previously installed LTS Package Just Run the Below commands apt will Handle it.

I upgrade from 10.X to 12.X

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get update && sudo apt-get install -y nodejs
  • Upgrade npm
sudo npm i -g npm