Let’s get you sorted on finding the Node.js version on your IBM i system using QSH—don’t worry, it’s not as tricky as it sounds, even if QSH can be a bit of a grumpy old tool! Since you’re working on IBM i, Node.js runs in the PASE (Portable Application Solutions Environment), and we’ll need to poke around there to get the version info.
Step 1: Get into QSH (and Cross Your Fingers)
QSH, or QShell, is IBM i’s take on a Unix-like shell, but it’s not always the happiest camper when dealing with open-source tools like Node.js. Still, we can make it work.
Start by launching QSH from your 5250 terminal (that green-screen beauty - or in my case a white/green screen beauty):
Type QSH on the command line and hit Enter. You’ll land in the QShell environment, greeted by a $ prompt. If you’re feeling nostalgic, it’s like stepping into a time machine to the Unix days—but with a bit of IBM i flair.
Heads-Up: QSH can be finicky with open-source stuff. Some folks online (like in those IBM i OSS docs) warn that 5250 interfaces like QSH might throw tantrums—think phantom inputs or weird characters. If things get wonky, you might want to switch to an SSH session (more on that later).
Step 2: Make Sure Node.js Is in Your PATH
Node.js on IBM i is typically installed in /QOpenSys/pkgs/bin via the yum package manager. But QSH won’t magically know where to find it unless your PATH is set up right.
Let’s check and fix that
(1) Run this to see your current PATH:
Look for /QOpenSys/pkgs/bin in the output!
If it’s there, huzzah... but if not, let’s add it temporarily for this session and then ECHO it to see the new value:
To make this permanent for future QSH sessions, add it to your user profile’s .profile file in your home directory (usually /home/yourusername):
Pro Tip: If you’re running multiple Node.js versions (IBM i lets you do that, because it’s fancy like that), the PATH might point to a specific version like /QOpenSys/pkgs/lib/nodejs20/bin. We’ll sort that out next.
Step 3: Check the Node.js Version
Now that your PATH is set, let’s ask Node.js to spill the beans on its version:
If you get a “command not found” error, don’t panic—Node.js might not be installed, or your PATH is still playing hide-and-seek. Double-check Step 2, or keep reading for troubleshooting.
Fun Fact: If node -v works, you’ve just made QSH do something useful—give yourself a pat on the back! If it fails, QSH might be sulking, which is pretty on-brand for it.
Step 4: If You Have Multiple Node.js Versions (Because IBM i Loves Options)
IBM i lets you install multiple Node.js versions side by side (like Node.js 16, 18, 20, etc.), and you can switch between them using the alternatives system. This can affect which version node -v reports.
Let’s check:
The asterisk (*) shows the current default. If you want to switch, just type the selection number (e.g., 3 for Node.js 20) and hit Enter. Then run node -v again to confirm.
Why This Matters: If you’re working on a project that needs a specific Node.js version (like the recommended Node.js 20 for IBM i, as we discussed earlier), this ensures you’re using the right one.
By now, you should know your Node.js version on IBM i using QSH. If you ran node -v and got something like v20.8.1, congrats—you’ve tamed the QSH beas
Got a version number? Great! If you’re curious about whether it’s the best version for IBM i Node.js 20 is a safe bet as of April 2025.