Yeah!!! I am going to give to try Node.js by creating small product. But don’t have Node.js developing environment ready in my work station. So, I installed by compiling from source via GIT repo. I can switch and update it easily. It’s quite easy. Just follow me.
If you don’t have installed GIT in your pc, then run the following commands, neither skip the following commands…
sudo apt-get update sudo apt-get install build-essential openssl libssl-dev pkg-config git-core
GIT installation is done. Now, clone the repository at /usr/local/src.
cd /usr/local/src sudo git clone git://github.com/joyent/node.git
Run the configure scritp which will actually ensure that nodejs is install globally in the system’s environment.
Then, run the following command for compiling and installing it…
sudo make sudo make install
One of the main reasons to choice GIT is that easy updating nodejs. It’s make easy updating the nodejs.
Just you will have to pull the latest source codes. And then repeat the whole installation process..
1 2 3 4 5
cd /usr/local/src/node sudo git pull origin master sudo ./configure sudo make sudo make install
Update and re-installation is done. Let’s make an example to test that nodejs is working well.
cat > ~/server.js <
Now open the browser, type http://localhost:1337. You will get “Hello world”. it’s done 🙂