sudo apt install build-essential
wget http://nodejs.org/dist/v0.10.9/node-v0.10.9.tar.gz
tar zxvf node-v0.10.9.tar.gz
cd node-v0.10.9
./configure make make install
Test node.js to make sure it’s working correctly.
echo "console.log('Hello World');" | node
This should simply print “Hello World” in the console.
If you don’t get any errors, node.js is installed and functional and you may just have executed your first node.js script.