What is NodeJS and does it work on my IBM i System?

Node.js is an open-source project based on the Google Chrome JavaScript Engine. It provides a platform for server-side JavaScript applications that can run without browsers. Developers often choose Node.js for real-time applications due to its event-driven architecture and non-blocking I/O API. The IBM i platform supports Node.js, allowing it to run on this system. Additionally, extensions have been created to enable Node.js applications to access IBM DB2® for i objects and other IBM i system resources.

Node.js is Open Source, and luckily for us, installing on our IBM i System is very easy!

Most of the open source components we will be using later, are based on Node.JS, so we need to follow these easy steps:

  • Node.js runs in the PASE environment on IBM i (ensure you have the PASE *LICPGM installed)
  • As always, read the official documentation before you do anything else... then..

TO CLARIFY: The Node Package Manager (npm) installer is a tool used to install packages for Node.js. It's a package manager for JavaScript, allowing developers to share and reuse code. It comes bundled with Node.js, so when you install Node.js, npm is installed automatically. npm provides a CLI to interact with the npm registry, where you can publish and install packages.

1

Install Node.js

Alright, let's get Node.js running on your IBM i system. It is a solid addition to your toolbox and runs nicely inside the PASE environment. Once it is installed you can use it for build tools, automation scripts, simple web services, or even calling out to your DB2 for i data from JavaScript. We will keep things simple and use the graphical Open Source Package Management feature inside IBM i Access Client Solutions.

Prerequisites

Before we start, make sure these pieces are in place:

  • PASE is installed on the IBM i. It is Licensed Program 5770-SS1 Option 33. You can check or install it with the GO LICPGM command.
  • You have IBM i Access Client Solutions (ACS) installed on your PC and you can connect to the target IBM i system.
  • Your user profile has enough authority to install open source packages. A profile with *ALLOBJ special authority usually works well, or the specific rights needed for RPM package installs.

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.

Install Configure IBM i - Node JS 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

Install Configure IBM i - Node JS 2

Logon with a Profile with authority

Install Configure IBM i - Node JS 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.

Install Configure IBM i - Node JS 4

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:

Install Configure IBM i - Node JS 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.

    Choose Node.js 2.0 🙂

    Install Configure IBM i - Node JS 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.

    Install Configure IBM i - Node JS 7

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

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