[node.js] How to install a specific version of Node on Ubuntu?

Here is a list of available builds for debian: https://github.com/nodesource/distributions/tree/master/deb

For this example, lets assume you want version 14 (LTS at the time of writing)

We can download this script from github, execute it and install the version of node we want. For security reasons it's a good idea to read the script prior to executing it.

curl -sL https://raw.githubusercontent.com/nodesource/distributions/master/deb/setup_14.x | bash
apt-get install -y nodejs # may or may not require sudo based on your setup 

I like this approach because it doesn't require extraneous dependencies like nvm to target specific versions

If you are building for a different distro or architecture you can find more builds here https://nodejs.org/dist/