Installing node.js on ubuntu server 15.10

Installing node.js

As mine was a clean Ubuntu installation, I needed to install certain libraries first.

sudo apt-get install g++ curl libssl-dev apache2-utils

The easiest way is to download node.js is to get a git clone. For that I needed to install the git package.

sudo apt-get install git-core

Now download node.js with git.

git clone git://github.com/ry/node.git

If you do not want to use git you could get the tar package instead.

wget http://nodejs.org/dist/node-v0.1.96.tar.gz
gunzip node-v0.1.96.tar.gz
tar -xf node-v0.1.96.tar

Now you are ready to install node.js.

cd node
./configure
make
sudo make install

Example node.js code

Below is a simple program using node.js for translating text using google API.

来自:http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/

你可能感兴趣的:(Installing node.js on ubuntu server 15.10)