Install node. js
Execute the following command in turn:
sudo apt-get update sudo apt-get install -y python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs
Note: Starting with node. JS v0.10.0, the node. JS installation package that is available in the Chris Lea repository contains the npm
and nodejs-dev
.
sudo add-apt-repository ppa:chris-lea/node.js
When you execute this instruction, the following prompt will appear asking if you are sure you want to add the PPA above:
[email protected]:~# sudo add-apt-repository ppa:chris-lea/node.js You are about to add the following PPA to your system: Evented I/O for V8 javascript. Node‘s goal is to provide an easy way to build scalable network programs More info: https://launchpad.net/~chris-lea/+archive/node.jsPress [ENTER] to continue or ctrl-c to cancel adding it
Don't bother, just press the 回车
key to ok!
Confirm that the installation is successful
node. JS is installed after the execution of the above series of instructions has been completed. Execute the following command to try the newly installed node. JS Bar:
node -v
When writing this article, the version of node. JS is v0.10.25, that is, the output is:
v0.10.25
Confirm that npm
the installation is correct, typing the following command:
npm -v
The output is:
1.3.24
As shown in the following:
node. js Ubuntu under Installation