sudo apt-get update
sudo apt-get install build-essential curl openssl libv8-2.0.3
sudo apt-get install build-essential curl openssl libv8-2.0.3
wget http://nodejs.org/dist/node-v0.4.11.tar.gz
gunzip node-v0.4.11.tar.gz
tar -xf node-v0.4.11.tar
cd node-v0.4.11
./configure
make
make install
gunzip node-v0.4.11.tar.gz
tar -xf node-v0.4.11.tar
cd node-v0.4.11
./configure
make
make install
curl http://npmjs.org/install.sh | sh
#!bin/sh
# Installing Nodejs, NPM and Google V8 on UBUNTU
# Save the code to a file as *.sh
# You should need the google V8
# Update version information here.
NODEJS=node-v0.4.11
TEMP_SOURCEDIR=${HOME}/temp_source
echo "Updating the packages list"
apt-get update
apt-get install build-essential curl openssl libv8-2.0.3
echo "Essential packages are installed"
# Pre-prep cleanup
if [ -d ${TEMP_SOURCEDIR} ]; then
rm -rf ${TEMP_SOURCEDIR}
fi
mkdir ${TEMP_SOURCEDIR}
cd ${TEMP_SOURCEDIR}/
# Download and install the Nodejs from source
echo "Downloading the Nodejs"
wget http://nodejs.org/dist/${NODEJS}.tar.gz
gunzip ${NODEJS}.tar.gz
tar -xf ${NODEJS}.tar
echo "Installing Nodejs"
cd ${TEMP_SOURCEDIR}/${NODEJS}
./configure
# make clean
make
make install
echo "Done"
# Installing the NPM
echo "Installing NPM"
curl http://npmjs.org/install.sh | sh
# Cleanup
rm -rf ${TEMP_SOURCEDIR}
# Installing Nodejs, NPM and Google V8 on UBUNTU
# Save the code to a file as *.sh
# You should need the google V8
# Update version information here.
NODEJS=node-v0.4.11
TEMP_SOURCEDIR=${HOME}/temp_source
echo "Updating the packages list"
apt-get update
apt-get install build-essential curl openssl libv8-2.0.3
echo "Essential packages are installed"
# Pre-prep cleanup
if [ -d ${TEMP_SOURCEDIR} ]; then
rm -rf ${TEMP_SOURCEDIR}
fi
mkdir ${TEMP_SOURCEDIR}
cd ${TEMP_SOURCEDIR}/
# Download and install the Nodejs from source
echo "Downloading the Nodejs"
wget http://nodejs.org/dist/${NODEJS}.tar.gz
gunzip ${NODEJS}.tar.gz
tar -xf ${NODEJS}.tar
echo "Installing Nodejs"
cd ${TEMP_SOURCEDIR}/${NODEJS}
./configure
# make clean
make
make install
echo "Done"
# Installing the NPM
echo "Installing NPM"
curl http://npmjs.org/install.sh | sh
# Cleanup
rm -rf ${TEMP_SOURCEDIR}
chmod +x install.sh
sudo sh install.sh
#Or
sudo ./install.sh
sudo sh install.sh
#Or
sudo ./install.sh
var sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
setTimeout(function () {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<br/><strong> Hello World!</strong>');
res.end();
}, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');
http = require('http');
http.createServer(function (req, res) {
setTimeout(function () {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<br/><strong> Hello World!</strong>');
res.end();
}, 2000);
}).listen(8000);
sys.puts('Server running at http://127.0.0.1:8000/');
node test.js
Done.