How to install latest nodejs package on Red Hat Enterprise Linux 6

node.jsrhel6

Would this sequence of commands work for RHEL?

apt-get install python g++ make
mkdir ~/nodejs && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`
./configure
make install

I should install it in the future, but I have no access to RHEL machine right now…

Best Answer

RHEL is RPM based Linux and apt-get is used for Deb based Linux .Yum is the Package Updater for RPM based Linux.

However you can download the latest NOdeJS package and compile it on your RHEl6

  http://nodejs.org/download/

  tar -zxf node-v0.6.18.tar.gz #Download this from nodejs.org
  cd node-v0.6.18
  ./configure && make && sudo make install

Or, if you'd like to install from the repository

  git clone https://github.com/joyent/node.git
  cd node
  git checkout v0.6.18 #Try checking nodejs.org for what the stable version is
  ./configure && make && sudo make install