[Solved] Node.js Error which: no g++

If you got below error while running ./configure command during node.js installation on Centos 4/5/6

which: no g++ in (/usr/lib/qt-3.3/bin:/usr/local/maven/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/poorak/bin)
gyp: Call to ‘(echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E – > /dev/null 2>&1) && echo “-m32” || true’ returned exit status 0. while loading dependencies of /opt/node-v0.10.0/node.gyp while trying to load /opt/node-v0.10.0/node.gyp
Error running GYP

You can solve this by running:

> sudo yum install gcc-c++ compat-gcc-32 compat-gcc-32-c++