Install first for ubuntu:
sudo apt-get install build-essential libssl-dev curl git-core
Compile the required node version and put in global reach:
# install nodejs from Github (replace 0.8.9 with required version)
git clone git://github.com/joyent/node.git node0.8.9
cd node0.8.9
git checkout v0.8.9
./configure --prefix=/usr/local/node0.8.9
make
sudo make install
cd ..
Add nodejs.sh
script to /etc/profile.d
# set PATH so it includes nodejs bin
export PATH="/usr/local/node/bin":"${PATH}"
Link /usr/local/node to correct version:
sudo ln -s /usr/local/node0.8.9 /usr/local/node
Adding/changing /etc/sudoers.d/secure_path
:
Defaults secure_path=/usr/local/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
(BTW users capable to use sudo
need to have the sudo
group in their group list!!)
Install node-inspector for debugging:
# install node-inspector from NPM repository
npm install node-inspector -g