In this tutorial, you will be introduced how to install Nodejs by using Distro-Stable Version or a PPA (personal package archive).
How To Install the Distro-Stable Version
First, you should refresh your local package index prior and then install from the repositories:
1 2 | sudo apt-get update sudo apt-get install nodejs |
Then, you should install npm (Node Package Manager) because by default Ubuntu Server 14.04 does not include npm package in nodejs package
1 | sudo apt-get install npm |
How To Install Using a PPA from NodeSource
The versions of Node.js on NodeSource are more up-to-date than the official Ubuntu repositories.
First, install the PPA in order to get access to its contents:
1 | curl -sL https://deb.nodesource.com/setup | sudo bash - |
Then, install Node.js package:
1 | sudo apt-get install nodejs |
Note that when you install from NodeSource, the Node.js package also contains npm package, so you do not need to install npm. But to make sure all npm packages can run right, you should need to install build-essential packge:
1 | sudo apt-get install build-essential |
To verify Node.js installed successfully, you type nodejs and see the command line >
0 comments:
Post a Comment