Background
Install ubuntu
apt
The latest LTS version through the official installation tool, node
and I am a bit obsessive-compulsive, like the pursuit of new things, that is, trying to install the latest version of the node
, so this article has been produced, attached ubuntu
installation node
and npm
command-line command:
install nodejs-legacysudo apt install npm
Latest Version Installation method
1. Installationnpm
sudo apt install npm
2. Upgrade npm
to the latest version
sudo npm install [email protected] -g
At this point npm -v
you can find npm
the version number is the latest version 3.10.3
;
3 nodejs
. Install the module for installationn
sudo npm install -g n
4, then through n
the module installation of the specified version nodejs
, the n
module more information please refer to the official documentation
//安装官方最新版本sudo n latest//安装官方稳定版本sudo n stable//安装官方最新LTS版本sudo n lts
We install the stable version nodejs
, and then we node -v
can find the node
installation is successful and the version number is v6.2.0
stable.
Install the latest stable version of node and NPM on Ubuntu