Update for 2022
Since this question was posted, version 16 became the newest LTS version. So Ahmed Boutaraa's answer is correct for the version 14 part of the question, but people stumbling on this question may be seeking the most recent LTS. If you follow those instructions, you will be stuck in version 14.
Luckily, NodeSource also provides an installation script that installs the current LTS rather than a specific version. That should make this answer a bit more future-proof. You can also get the same info straight from the source.
How to install the latest LTS version
This set of instructions will install whatever version is the latest LTS version. When a new version is released, you may have to run these instructions again to pull the new install script for the new version.
# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# As root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
How to install the latest non-LTS version
This set of instructions will install whatever version is the latest non-LTS version. When a new version is released, you may have to run these instructions again to pull the new install script for the new version.
# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs
# As root
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs
How to lock into v17 (latest, for now)
# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs
# As root
curl -fsSL https://deb.nodesource.com/setup_17.x | bash -
apt-get install -y nodejs
How to lock into v16 (current LST)
# As a user with sudo
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
# As root
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
sudo snap refresh node --channel=11/stable