Node.js is a Javascript programming platform that allows users to build network applications very easily. Many developers want to build applications and libraries using JavaScript (server-side and client-side).
In this guide, we’ll show you how to get started with Node.js on an Ubuntu 14.04 server. First of all make sure that all packages are up to date.
apt-get update apt-get upgrade
Install Node.js with Ubuntu Package Manager
Ubuntu 14.04 contains a version of Node.js in its default repositories that can be used to install.
To get this version, we just have to use the apt package manager.
sudo apt-get install nodejs
Then install the node package manager, npm:
sudo apt-get install npm
Create a symbolic link for node, as many Node.js tools use this name to execute.
sudo ln -s /usr/bin/nodejs /usr/bin/node
Now we should have both the node and npm commands working:
node –v npm -v
Install Node.js with Maintained Ubuntu Packages
Add the Node.js-maintained repositories to your Ubuntu package source list with this command:
curl -sL https://deb.nodesource.com/setup | sudo bash -
Then install Node.js with apt-get:
sudo apt-get install nodejs
Optionally we can create a symbolic link for node (for reasons mentioned earlier):
sudo ln -s /usr/bin/nodejs /usr/bin/node
Using this install option, we end up with newer versions of Node.js and npm:
node –v npm –v
Congratulation’s! You have successfully installed Node.js.