using nodejs as an example

Search for the available versions:

sudo yum list nodejs --showduplicates


This returns something like:

nodejs.i686       0.10.48-3.el6
nodejs.x86_64 0.10.48-3.el6
nodejs.x86_64 5.11.1-1nodesource.el6

Therefore, to install version 5.11.1:

yum install nodejs-5.11.1-1nodesource.el6

As can be seen, it's a case of removing the extension from the package name (i.e nodejs.x86_64 becomes nodejs) and then concatenating the version by way of a hyphen, the result being  nodejs-5.11.1-1nodesource.el6