Download Setup Node.JS on IBM i

  • Home
  • /
  • Blog
  • /
  • Download Setup Node.JS on IBM i

March 22, 2024

Download Setup Node.JS on IBM i

Following on from my previous blog, it’s time to use IBM i ACS to download and install Node.JS on our IBM i Power System.

To install Node.js on IBM i, you have a few options, but my preferred technique is to install Node.js on IBM i using the open-source RPM packages, not the old 5733-OPS licensed program. IBMโ€™s own guidance treats the package manager as the production path, with nvm only for development version-switching.

Download Setup Node.JS on IBM i 1

5733-OPS is deprecated and is not shipped on IBM i 7.4 and later. Anything still installed under /QOpenSys/QIBM/ProdData/OPS is a legacy layout. New work should live under /QOpenSys/pkgs.

Prerequisites

You need these before either install method will work:

  • IBM i 7.3 or later is the practical baseline (7.2 can work with the older repo layout; 7.4, 7.5, and 7.6 are the normal targets).
  • PASE: licensed program 5770-SS1 option 33 (Portable Application Solutions Environment). Check with GO LICPGM.
  • SSH server running: 5733-SC1 option 1, then STRTCPSVR SERVER(*SSHD). ACS Open Source Package Management talks to the system over SSH.
  • A profile with *ALLOBJ for the install. Avoid QSECOFR for the SSH session if you can; ACS often fails authentication with that profile.
  • The IBM i partition, or at least the PC running ACS, must be able to reach IBMโ€™s public RPM repository (public.dhe.ibm.com). ACS can pull packages from the PC side, so the IBM i itself does not always need outbound HTTPS.

Qshell (CALL QP2TERM) is fine for later use. Install and package management are cleaner from a real SSH session.


Method 1: ACS Open Source Package Management (recommended)

This is the path most people should use. It bootstraps yum if it is missing, resolves dependencies, and does not require you to hand-edit repository files.

  1. Install a current IBM i Access Client Solutions (1.1.9.6 or later).
  2. In ACS: Tools โ†’ Open Source Package Management (older ACS builds put it under Actions โ†’ Management).
  3. Connect with the SSH user. If yum is not present, ACS offers to bootstrap the open-source environment. Accept that.
  4. Open the Available packages tab.
  5. Search for nodejs. You will see separate packages per major version (nodejs18, nodejs20, nodejs22, and so on). A plain yum upgrade never jumps major versions.
  6. Install the even-numbered LTS you intend to run. Confirm the dependency list and let it finish.

Official ACS package-management steps are in IBMโ€™s technote Getting started with Open Source Package Management.

Let’s go through this technique step by step:

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.

Download Setup Node.JS on IBM i 2

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

Download Setup Node.JS on IBM i 3

Logon with a Profile with authority

Download Setup Node.JS on IBM i 4

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.

Download Setup Node.JS on IBM i 5

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

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

Download Setup Node.JS on IBM i 6

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.

    Choose Node.js 2.0 ๐Ÿ™‚

    Download Setup Node.JS on IBM i 7

    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.

    Download Setup Node.JS on IBM i 8

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


    Method 2: yum from SSH

    Once the open-source environment exists, the command-line equivalent is:

    export PATH=/QOpenSys/pkgs/bin:$PATH
    yum install nodejs22

    Replace nodejs22 with the major you want. Useful follow-ups:

    yum search nodejs
    yum list available 'nodejs*'
    yum update nodejs22

    Minor and patch updates stay inside that package. Moving from 20 to 22 is a new install, not an upgrade.

    Set the system default with alternatives:

    /QOpenSys/pkgs/bin/alternatives --config node
    node --version
    npm --version

    Binaries for a specific major live at /QOpenSys/pkgs/lib/nodejs22/bin/node. If several majors are installed, either use alternatives or put the version you want first on PATH.

    Put this in the userโ€™s .profile (or the jobโ€™s startup) so later SSH and QP2TERM sessions find it:

    export PATH=/QOpenSys/pkgs/bin:$PATH

    IBMโ€™s usage notes are the source of truth for version selection, alternatives, and PATH: Node.js usage notes.

    Which version to install

    Follow the Node.js release schedule, not whatever package sorts first in ACS.

    • Production: even-numbered majors only, and only while they are in Active LTS or Maintenance LTS.
    • As of late September 2026, Node 22 is in maintenance (security support through April 2027) and Node 24 is the current LTS line (security support through April 2028). Node 20 is at end of life. Odd majors (21, 23, 25) are not for production.
    • Confirm the package is actually in the IBM i repo before you plan around it. IBM i packages lag the nodejs.org release by a short interval, and not every major is packaged.

    Multiple majors can coexist. Global npm modules do not. If you switch majors, or you are coming from 5733-OPS, reinstall global modules under the new runtime. Prefer local project installs over npm install -g.


    Method 3: nvm (development only)

    IBM documents nvm as the second option, for people who need to build or switch versions that are not in the RPM repo. It is not the production recommendation.

    You need the development tools first:

    yum group install "Development Tools"
    yum install gcc10\* curl wget

    Then install nvm from its project instructions, and put these in $HOME/.nvmrc so the Power build succeeds:

    --dest-cpu=ppc64
    --without-snapshot
    --shared-openssl
    --without-perfctr

    Also export OBJECT_MODE=64 and point CC/CXX at the open-source gcc. Builds are slower and more fragile than the IBM-built RPMs, and native addons compiled this way are your problem to keep working across PTFs.


    After Node.JS is installed on IBM-i OS

    Verify from SSH, not from a 5250 command line:

    node --version
    npm --version
    which node

    For IBM i integration, the usual next packages are itoolkit (call RPG, CL, and service programs) and an ODBC path (odbc plus the IBM i Access ODBC driver, DSN *LOCAL when the app runs on the box). Native modules that need a compile also need the Development Tools group.

    CCSID still matters. A profile CCSID of 65535 will bite you in npm and in file I/O. Use a real CCSID (37, 273, 5035, 1208, depending on the shop) on the profile that runs Node, and prefer UTF-8 source in the IFS.

    If the goal is a web service in front of existing RPG, the Node process is typically started from a submitted job or from Apache reverse proxy on 5770-DG1, not left running in an interactive SSH session.

    We can also verify from the IBM-i command line using PASE

    QP2TERM is a program that starts a bash-like terminal. It is used to run an IBM i Portable Application Solutions Environment (IBM PASE for i). To launch the PASE interactive environment, you can call QP2TERM. Once inside PASE, you can run commands.

    From an IBM i Command line call qp2term which will enter you into the PASE environment:

    call qp2term

    Now you can go through the steps to verify your PASE environment and also check that Node.JS is installed and running healthily:

    What not to do

    • Do not install 5733-OPS option for Node.js on a current system. It is the old delivery vehicle, version-frozen, and absent from 7.4 onward.
    • Do not download a generic Linux ppc64le tarball from nodejs.org and drop it in the IFS. The IBM i packages are built for PASE and linked against the open-source OpenSSL in /QOpenSys/pkgs.
    • Do not leave PATH pointing at an old /QOpenSys/QIBM/ProdData/OPS/Node* tree if you have also installed the RPM. You will run the wrong node and the wrong npm.

    NickLitten


    IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits.

    Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day.

    Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

    Nick Litten

    related posts:

  • Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but instead of that, this is excellent blog. A fantastic read. I’ll certainly be back.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    Subscribe NOW
    7-day free trial

    Take This Course with ALL ACCESS

    Unlock your Learning Potential with instant access to every course and all new courses as they are released.
     [ For Serious Software Developers only ]

    Online Learning for IBM i Software Technology Professionals

    โ€œThe more that you read, the more things you will know. The more that you learn, the more places youโ€™ll go.โ€ โ€“ Dr. Seuss

    >