you need to have Node.js installed, configured and working.
How to install Node.js on centos 6.3.
also, check you have curl installed:
[code lang=”bash”]yum install curl[/code]
npm can be installed using rpm or repo but there are situations where you might want to install npm using the install.sh script.
CentOS minimal doesn’t include the ‘which’ command.
npm install.sh patch
because the install.sh script uses the command ‘which‘, you need to create a patch.
create a ‘which’ file in your /bin directory and add inside:
whereis $1 | cut -d ” ” -f2[/code]
[code lang=”bash”]cd /bin
chmod +x which[/code]
check with ‘which node’ which should return ‘/usr/bin/node’ if you installed node.js using the rpm or repo.
finally, run the following:
[code lang=”bash”]cd /tmp
curl -s http://npmjs.org/install.sh > npm-install-$$.sh
For me, it was npm-install-4691.sh, but it could be with other name.
You can now use the install.sh script on your CentOS minimal.