For those of us using Node.js on our IBM i, you are probably aware of an Open Source utility, provided by IBM, called NodeVer (Is that Node Ver? or is it Nod Ever?, I’ll leave it with you to call it whatever you like!).
NodeVer was a great utility allowing you to have more than one version of node.js installed on your box and use a specific version.
On my server I have Node.js version 8 and version 10 installed and NodeVer allows me to switch between the two.
Please be aware, if I change the version, it will be a global change and effect all users – be sure before you change versions!
Now we have all got used to using NodeVer, IBM has decided to call a day on it.
If you are not familiar with NodeVer, let me have a quick recap on the functionality of NodeVer.
NodeVer was available from IBM in their Open Source repositories.
We can see from the figure below, I have NodeVer installed along with Node.js version 8 and 10.
If I run NodeVer list, it shows me the two node versions I have just spoken about, which can be seen below.
For those of you with 20-20 vision, you will see on the screen shot above, that in fact NodeVer now uses the update-alternative package.
Which leads me neatly onto …
What do we use instead?
Good question, and the answer is Update-Alternatives. There is no way I can split that up into different sayings!
Update-Alternatives has been around, on other operating systems for a long while and not only used for different versions of Node, but it can also be used on other languages too.
- If I run nodever –version it shows the current version of NodeVer is 1 and is now depreciated
- Nodever recommends using update-alternatives as a substitute for NodeVer
- Update-alternatives shows its installed at version 1.19.7
As with nodever, update-alternatives can be installed on a command line using:
yum install update-alternatives
Or you could use ACS Open Source Package Management feature to install this package.
Either way will get the job done and we now have the newer method of selecting what version of node to use for our applications.
As I said earlier, due to client restraints, we use Node.js at version 8 for our applications.
- Node version – 8.17
- Using alternatives with the config parameter and specifying node as the programming language
- Here we can see my two versions of node.js 8 and 10
- If I want to change to node version 10, I will input a 1 here
As you can see, update-alternatives can be shortened to just alternatives – nice!
As we now have a replacement for NodeVer, is can safely be removed from our server. Again, either use Yum from a shell session to achieve this, or good old Open Source Package Management.
Be aware – I did the above on our server and by removing NodeVer it also removed Node.js 10, as it was a dependency!
Luckily, we do not use Node 10! Is that intended IBM? I have raised a PMR on it, just in case.
Yes, NodeVer will continue to work, but it is not getting any updates, so my best advice is to start using the better tool for the job Update-Alternatives.
You will benefit from it in the future, especially if you use open source programming languages other than Node.js, for example Python.
If you have any questions, either on this article, or any other open source, use the comments below, or send me a message on twitter @AndyYouens
Andy Youens is an IBM i consultant/instructor at Milton Keynes, UK-based FormaServe Systems with over 40 years IBM midrange experience.
Leave a Reply