NodeJS is currently not part of the CentOS standard repo's
Give it a try:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cat.pdx.edu
* extras: mirrors.cat.pdx.edu
* updates: mirrors.cat.pdx.edu
Setting up Install Process
No package nodejs available.
Error: Nothing to do
Solution
Install NodeJS from sources.Install Dependencies
# yum install openssl-devel
# yum install gcc-c++
-- OR --
# yum groupinstall 'Development Tools'
Install NodeJS
# mkdir ~/sources# cd ~/sources
# wget http://nodejs.org/dist/node-latest.tar.gz
# tar zxvf node-latest.tar.gz
# cd node-v<TAB>
# ./configure
# make
# make install
# mv /root/sources/node-v0.10.1/out/Release /opt/node-v0.10.1
# ln -s /opt/node-v0.10.1/node /usr/bin/node
NOTE: When you cd to the newly created directory, type "cd node-v" and then hit your TAB key for tab completion. The full directory name will be something like /root/sources/node-v0.10.1
Test NodeJS
# nodev0.10.1
Thank you! This was really useful for me, the first google link has an expired URL for the "wget" node command, but after filtering out old results, I came across this, thank you again!
ReplyDeleteThank you so much, its very useful and easy to understand. just one detail if you want to show the version. (node -v)
ReplyDeletethanks for this tip!!!!
DeleteBrilliantly simple
ReplyDeleteVery simple!! that is good post, thanks
ReplyDeleteThanks :)
ReplyDeletehow to install lex and yacc in centos? can u plz help me?
ReplyDeleteI tried to follow but had one error (centos 6.4 - 26JULY)
ReplyDelete[root@ip-10-179-7-27 sources]# wget http://nodejs.org/dist/node-latest.tar.gz
-bash: wget: command not found
-> yum install wget fix it ;)
hope it helps
More simple use epel repository
ReplyDeleteyum install nodejs
Done!
I agree with Anonymous! I always opt to use yum to install packages. It helps with the management down the road, too. At the time I wrote this article, I don't think an epel repo for nodejs existed. It obviously does now. So, my instructions are now deprecated. Thank you, Anonymous!
ReplyDeletethe version installed by yum is very old.
ReplyDeleteThank you very useful, simple and easy
ReplyDeleteVery fine!
ReplyDeleteI tried to install it with epel on Centos7 but got a bunch of errors.
Thanks Lex! This is good instruction! I only received the bunch of errors with make command.
ReplyDeleteThanks Lex! This is good instruction! I only received the bunch of errors with make command.
ReplyDeleteThank you for sharing this information. This article is very interesting and useful. Keep up the good work!
ReplyDeleteKanhasoft is the top-notch Node.js App development company in India. We have 45+ experienced programmers to delivered successful NodeJS Application development globally. Visit our site to know more about us.
ReplyDeleteVery Helpful and informative blog! Keep sharing such blogsSoftware Development Company in India
ReplyDeleteExpresstech Softwares is a leading node.js Development Company provider company. Hire Node.js developer from us who are expert in each development aspect. Contact us: +91-9806724185 or Contact@expresstechsoftwares.com
ReplyDelete