6

I'm currently working with a CentOS box that has a version of node installed, when I do:

nodejs -v

I get

v0.6.18

But I noticed on nodejs.org website, that the latest release is 0.8.12, so do:

sudo yum update nodejs

I get

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos-mirror.jchost.net
* epel: fedora-epel.mirror.lstn.net
* extras: centos.mirror.lstn.net
* updates: centos.mirror.lstn.net
Setting up Update Process
No Packages marked for Update

What's the deal? Why doesn't yum find the latest version of node? Do I have to download the .tar.gz from nodejs.org and install it that way?

2 Answers 2

1

It doesn't look like you have the NodeJS Yum repository loaded on your system. Follow the instructions at Node's "Installing Via Package Managers" page to load the repository onto your system, run yum clean all once for good measure, and then try the yum update command again. If you got Node from a non-Yum source (e.g. building form source), you may have to run a yum install nodejs (rather than update) or whatnot in order to start managing your NodeJS instance via Yum.

Also, since Node is so heavily developed, and releases so often, it's possible that RPM packagings of more recent versions may not percolate down into the Yum repositories for distribution for some time (that's my experience with EPEL and a lot of rapidly-developed software). If that's the case, consider using a third-party/other Yum repository that packages and/or tracks new Node versions (like this one), or using a different package manager (does npm support updating the Node instance it runs on?) or manually downloading/installing the software.

7
  • Will try your suggestions, but will yum clean all ruin other packages already installed?
    – ariestav
    Oct 16, 2012 at 17:25
  • 1
    No, that just resets yum's cache of what is available via remote repositories. No installed software is touched. Reference: yum.baseurl.org/wiki/YumCommands
    – Zac B
    Oct 16, 2012 at 17:26
  • A good first step would be to run yum list nodejs to see if your Node install is even managed by Yum. If it isn't, any Yum-distributed version you acquire is likely going to be set up slightly differently/require reconfiguration etc.
    – Zac B
    Oct 16, 2012 at 17:27
  • It looks like yum list nodejs shows it's managed by yum. I added the repo file you linked to, but alas, it didn't update :(
    – ariestav
    Oct 16, 2012 at 17:35
  • In that case, it was probably put on your machine via tarball/source install. Make sure you have all of your relevant Node configs backed up and safe, then do your best to remove all vestiges of Node from your system (this reduces confusion later on re: which things were installed prior, and which things were installed via yum), and then run a yum install nodejs nodejs-compat-symlinks npm to have it managed by Yum from there on out. It might be a hassle to uninstall/reinstall, but in the long run it should pay off; you get upgrade functionality and a listing of what is installed for free.
    – Zac B
    Oct 16, 2012 at 17:43
0

I wrote a script that handles this. Follow the following steps:

# retrieve
curl https://gist.github.com/4348083/download > centos5.8-upgrade-nodejs0.8.16.tar.gz

# extract
tar -xvf centos5.8-upgrade-nodejs0.8.16.tar.gz --strip 1

# prepare
chmod 744 centos5.8-upgrade-nodejs0.8.16.sh

# execute
sudo ./centos5.8-upgrade-nodejs0.8.16.sh

# cleanup
sudo rm -r bzip2-1.0.6* centos5.8-upgrade-nodejs0.8.16* Python-2.7*
2
  • If I understand this correctly, it leaves you pegged at version 0.8.16 (current version is already 0.8.19), which doesn't address the original question of wanting to have the node.js installation updated via yum.
    – Steve P
    Feb 16, 2013 at 13:39
  • Its not a solution to your question (no Yum), but the tool called "n" automatically downloads and compiles the latest, or latest stable, versions of Node. You could automate that via a cron script or similar and have a relatively easy way to stay up to date. github.com/visionmedia/n
    – Zac B
    Feb 16, 2013 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .