How to install nodejs 5.3 on Centos 6.6

How to install nodejs 5.3 on Centos 6.6

Check OS version :

#  cat /etc/redhat-release
    CentOS release 6.6

Download latest nodejs

# wget https://nodejs.org/dist/v5.3.0/node-v5.3.0.tar.gz

Extract and compile 

# tar -xzvf node-v5.3.0.tar.gz
# cd node-v5.3.0
# ./configure

Error came 

WARNING: failed to autodetect C++ compiler version (CXX=g++)
WARNING: failed to autodetect C compiler version (CC=gcc)
Node.js configure error: No acceptable C compiler found!

Install compiler C++

# yum groupinstall 'Development Tools'

Then try to compile it again

#  ./configure

Common error came while compiling latest nodejs with old version of C compiler 

WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)

Upgrade our compiler to compile latest nodejs

#  curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo
#  rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-     GPG-KEYs/RPM-GPG-KEY-cern
#  yum install -y devtoolset-3
#  scl enable devtoolset-3 bash
#  ./configure
#  make && make install

It takes time to compile and build nodejs. After installation check node -v and npm -v


How to install nodejs 5.3 on Centos 6.6 How to install nodejs 5.3 on Centos 6.6 Reviewed by vivek sathisan on 12:32 Rating: 5

No comments:

© Copyright to vivek sathisan. Powered by Blogger.