Monday, August 13, 2012

Say 'Hello world' using Node.js

Install node.js on Ubuntu

Install the dependencies:
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
Download source code of version 0.8.8 from github:
git clone -b v0.8.8-release git://github.com/joyent/node.git
Build and install node.js:
cd node
sudo ./configure
sudo make
sudo make install
To get node.js version type:
node --version
Create Hello world application

Create my-script.js file:
console.log("Hello world!!!")
Run the code:
node my-script.js
Output:
Hello world!!!

No comments:

Post a Comment