Installing Node.js and npm from NodeSource

The script will add the NodeSource signing key to your system, create an apt repository file, install all necessary packages, and refresh the apt cache.

If you need another Node.js version, for example 12.x, change the setup_14.x with setup_12.x.

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

Verify that the Node.js and npm were successfully installed by printing their versions:

node --version