Installing the open source environment (yum and ACS)

Section 3: Installing Node.js on IBM i

The Main Event: Installing Node.js on IBM i

Before we can install Node.js we need IBM's open source package environment on the box. If someone in your shop has already done this, you can skip ahead - but read on anyway, it's riveting stuff.

Prerequisites
  • IBM i 7.4 or later recommended (7.3 is out of support; current Node.js RPMs target supported releases).
  • The SSH daemon running: STRTCPSVR SERVER(*SSHD) from a 5250 command line. (To autostart it: CHGTCPSVR SVRSPCVAL(*SSHD) AUTOSTART(*YES).)
  • IBM i Access Client Solutions (ACS) on your PC.
  • 5733-SC1 (IBM Portable Utilities - OpenSSH) installed.

Option A: ACS Open Source Package Management (easiest)

  1. Open ACS, select your system.
  2. Go to Tools → Open Source Package Management.
  3. Sign in. If the environment isn't installed, ACS offers to install the open source environment (the "bootstrap"). Say yes.
  4. Once done you get a GUI with Installed packages, Updates available and Available packages tabs. Lovely.

Install NodeJS using IBM i ACS

To install open-source software on IBM i, you’ll need the appropriate authority and follow the right steps.

Installing the open source environment (yum and ACS) 1

IBM i Node.js SDK

If you’re installing Node.js (or any other open-source package) using the IBM i Node.js SDK, you’ll need sufficient authority to install software on your system. Obviously you will need to ensure you have the necessary permissions to install RPM packages.

PASE (Portable Application Solutions Environment):

When working with open-source software via PASE, you’ll need the following authority:

  • USE authority to the PASE environment.
  • OBJEXIST authority to the directories where you plan to install open-source packages.
  • EXECUTE authority on the installation scripts or commands.
  • Additionally, ensure you have the authority to create directories and files within the PASE environment.

IBM i Access Client Solutions (ACS):

If you’re using ACS to manage open-source packages, you’ll need the necessary authority to:

  • Download software (such as RPM packages) using ACS.
  • Install the downloaded packages.
  • Update existing packages.

Ensure you have the appropriate permissions to perform these actions.

Community Support:

  • For community-supported open-source projects (e.g., Node.js packages), you can raise defects or seek assistance on community channels like GitHub.
  • While IBM provides some level of free community support for specific integration pieces, it’s essential to engage with the relevant open-source community for assistance.

For more information on installing open-source packages, visit the IBM i RPM Packages page.

Launch IBM i ACS Open Source Package Management

Installing the open source environment (yum and ACS) 2

Logon with a Profile with authority

Installing the open source environment (yum and ACS) 3

Open Open Source Package Management in ACS

You will now see a screen that lists all the open source packages already installed on your system.

If you scroll down and find node.js is installed, then you are good to go.

Installing the open source environment (yum and ACS) 4

If it is not installed then simply click the AVAILABLE PACKAGE heading and scroll down to find nodejs20 (or your preferred version).

Production should use an available, supported Node.js LTS release, not simply the newest package

You will see several different versions of node.js available for ibm i systems:

Installing the open source environment (yum and ACS) 5

Let’s explore the differences between Node.js versions 14, 16, 18, and 20. Each of these versions brings its own set of features and improvements:

  • Node.js 14 (LTS):
    • End-of-Life: Node.js 14 will go End-of-Life in April 2023.
    • Stability: It’s an LTS (Long-Term Support) version, which means it’s stable and well-supported.
    • Recommended for Production: Ideal for production environments where reliability is crucial.
    • Features: Node.js 14 introduced features like worker threads, V8 engine updates, and improved diagnostics.
    • Considerations: If you’re currently on Node.js 14, plan to upgrade to either Node.js 18 (LTS) or Node.js 20 (soon to be LTS).
  • Node.js 16 (LTS):
    • End-of-Life: Node.js 16 will go End-of-Life in September 2023 (brought forward from April 2024 due to OpenSSL 1.1.1 support).
    • Stability: Another LTS version with stability and long-term support.
    • Features: Node.js 16 introduced ECMAScript modules (ESM), V8 updates, and performance improvements.
    • Use Cases: Suitable for applications that benefit from ESM and need long-term support.
  • Node.js 18 (LTS):
    • Preferred LTS Version: As of now, Node.js 18.14.0 is the preferred LTS version.
    • Stability: Provides stability and long-term support.
    • Features: Node.js 18 includes enhancements like URL, fetch(), and EventTarget improvements.
    • Considerations: If you’re looking for a stable LTS version, Node.js 18 is a good choice.
  • Node.js 20 (Current):
    • Not Yet LTS: Node.js 20 is the current release and will enter LTS in October.
    • Features: Node.js 20 introduces the Permission Model (restricting access to resources), synchronous import.meta.resolve, and other improvements.
    • Performance: Leverages V8 Fast API calls for better performance.
    • Evaluation: Explore the new features and evaluate their impact on your applications.
  • In summary, choose the LTS versions (14, 16, or 18) for production systems, and consider Node.js 20 for experimentation and feature exploration.


    Life on the modern edge is fun.


    Today, I choose Node.js 2.0 🙂

    Installing the open source environment (yum and ACS) 6

    Enter a 'Y', sit back and sip your cup of tea (either ASSAM or EARL GRAY is acceptable) and watch Node.JS install on your IBM i System.

    Installing the open source environment (yum and ACS) 7

    HUZZAH! node.js is installed on my IBM i System

    Option B: Command line

    If the bootstrap is already done, everything else is just yum from an SSH session:

    ssh NICK@myibmi
    /QOpenSys/pkgs/bin/yum --version
    /QOpenSys/pkgs/bin/yum repolist

    Use bash, not the default shell

    The default PASE shell is a bit grumpy.

    What do I mean by *grumpy*?

    The default PASE shell is functional, but let's be honest, it feels a bit like working on a green-screen terminal from the 1980s. That's why most IBM i developers install Bash (Bourne Again Shell) as soon as they start using open source tools. Bash provides a modern Linux-style command environment with powerful features such as command history, tab completion, command aliases, scripting capabilities, environment variables, and a much friendlier user experience. If you've worked with Linux, macOS, Docker, or cloud servers, Bash will immediately feel familiar.

    On IBM i, Bash runs inside the Portable Application Solutions Environment (PASE), which provides an AIX-compatible runtime for open-source software. Once installed, Bash becomes the command-line foundation used by many modern IBM i development tools, including Git, Node.js, Python, Make, Yum/DNF package management, and numerous open-source utilities. Setting Bash as your default shell means every SSH session starts in a modern development environment rather than the more limited Qshell or standard PASE shell.

    For example, with Bash you can create useful shortcuts:

    alias ll='ls -la'
    alias wrk='/QOpenSys/pkgs/bin/git status'

    You also gain access to powerful shell scripting:

    #!/QOpenSys/pkgs/bin/bash

    echo "Today's date:"
    date

    system "DSPSYSVAL QTIME"

    Think of Bash as the developer's toolbox for IBM i open source. RPGLE remains the king of business logic and Db2 processing, while Bash acts as the glue that automates tasks, manages source code, runs builds, deploys applications, and launches open-source tools. If RPG is the engine driving your business applications, Bash is the workshop where modern IBM i development gets done.

    Install bash and make it your default:

    /QOpenSys/pkgs/bin/yum install bash
    /QOpenSys/pkgs/bin/chsh -s /QOpenSys/pkgs/bin/bash

    Fix your PATH

    Add the open source binaries to the front of your PATH if you do not see them there already.

    Create or edit ~/.profile (your home directory is in the IFS, e.g. /home/NICK):

    # ~/.profile
    PATH=/QOpenSys/pkgs/bin:$PATH
    export $PATH

    Log out and back in, then check:

    echo $PATH

    You should see /QOpenSys/pkgs/bin/ in the path.

    Now we can just type commands like normal people.

    You should see /QOpenSys/pkgs/bin/yum. Now we can just type yum like normal people.

    Tip: Your home directory must exist. If cd ~ complains, create it: mkdir /home/NICK (and make sure the user profile's HOMEDIR points to it).

    Check if Node.js is already installed

    On IBM i, the quickest way to check if Node.js is installed is to open an SSH session or a PASE/Bash shell and run:

    node -v

    If Node.js is installed, you'll see something like:

    v22.15.0

    If you get a message such as:

    node: not found

    then Node.js is either not installed or not in your PATH.

    To see where IBM i installed it, use:

    which node

    A typical result might be:

    /QOpenSys/pkgs/bin/node

    Install Node Version 20 like this

    yum install nodejs20

    IBM distributes Node.js as RPM packages, and nodejs20 is the package name for the Node 20 LTS release. Multiple Node.js versions can coexist on the same IBM i partition, so you can have nodejs20 and nodejs22 installed simultaneously if needed.

    You can also check the installed package using DNF:

    dnf list installed | grep nodejs

    or

    rpm -qa | grep nodejs

    Example output:

    nodejs-22.15.0-1.ppc64

    In Summary: To verify that Node.js is installed on IBM i, open a Bash session and run node -v. If Node.js is available, the command displays the installed version number. You can also run npm -v to confirm that the Node Package Manager is installed. If the commands are not found, Node.js may need to be installed using DNF. Checking with which node or dnf list installed provides additional confirmation of the installation location and package details.

    NODEVER on IBM i

    NODEVER is a simple IBM i utility that makes it easy to switch between multiple installed Node.js versions without editing aliases or PATH variables. If you have Node 20, Node 22, and other releases installed, NODEVER lets you select which version should be used in your current shell session. install using 

    yum install nodever

    Why use NODEVER?

    NODEVER is particularly useful when:

    • Developing applications that depend on specific Node.js versions.
    • Testing applications against multiple releases.
    • Running legacy Node 20 workloads while evaluating Node 22 features.
    • Teaching IBM i open source development where students may have different Node requirements.
    {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
    >