NodeSource is a company focused on providing enterprise-grade Node support and they maintain a repository containing the latest versions of Node.js.
Use this repository if you need to install a specific version of Node.js. At the time of writing, NodeSource repository provides the following versions – v13.x, v12.x, v11.x, v10.x, and v8.x.
Install NodeSource Repository
Just like nvm
, we’ll get nodesource
repository using curl
likeso,
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
The command will add the NodeSource signing key to your system, create an apt sources repository file, install all necessary packages and refresh the apt cache.
Install NodeJS
Once nodeSource installation is done, we can simply install NodeJS
sudo apt install nodejs
This will install both node
and npm
binaries.
Verify the install
Now we can simply verify if node installed perfectly on our systems.
node -v
npm -v