Ubuntu install the latest version nodejs

Transfer: ubuntu quickly install the latest version nodejs, just 2 steps

The first step to nodejs official website https://nodejs.org to see the latest version;

 

That moment, 12.6.0 is the latest version, but if you wanted stability and the proposed election 10.16.0 LTS version.

The second step, the source added installation
focus here, nodejs each major version number has a corresponding source, such as source 10.xx version here is https://deb.nodesource.com/setup_10.x.

Therefore, in a terminal execute:

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

 

Wait a moment, the source has been added, then execute:

sudo apt-get install -y nodejs


Wait for the installation to complete.

 

Incidentally, if you want to install version 12.xx, you only need to modify the number to add the source address, for example:
curl -sl https://deb.nodesource.com/setup_12.x | -E sudo bash -

Finally, verify, execute: nodejs -v version number can appear just installed.

 

Guess you like

Origin www.cnblogs.com/feiquan/p/11223487.html