Issues with QP2TERM and nodejs v12.8.1

Issue #80 resolved
John S created an issue

On our v7.2 system, we previously had node v10.16.1 installed. I’ve used yum to install nodejs12 (v12.8.1) which has created a new instance rather than upgrading the old. There are several issues with this however.

Firstly, it doesn’t update the /QOpenSys/pkgs/bin/node symbolic link to use nodejs12, it still points to nodejs10. Issuing node -v shows 10.16.1 still. If I erase nodejs10 and then install nodejs12, the symbolic link reflects nodejs12 correctly as shown:

Object link . . . . . : /QOpenSys/pkgs/bin/node

Content of Link . . . : /QOpenSys/pkgs/lib/nodejs12/bin/node

After doing this however, node 12 doesn’t work in the IBM i pase environment. If I use it in putty, it seems to work, but in QP2TERM, I get the following error:

node -v
[31306]: ../src/node.cc:560:void node::PlatformInit(): Assertion `(err) == (0)' failed.
IOT/Abort trap(coredump)

Comments (4)

  1. Kevin Adler

    For the symlinks, you can use nodever to change the default version of Node to use. This is not changed by default when installing a new version as you may want to use the existing version while only evaluating the new version.

    The crash is due to the way PASE is coded to pretend to be running in a true TTY device when run from QP2TERM or QSH inside a 5250 emulator, while it is not actually running from a true TTY device. Node.js now does more interaction with the terminal by calling TTY-related functions and does not expect the OS to lie to it. You can work around this by setting the environment variable PASE_STDIO_ISATTY=N prior to calling QP2TERM or QSH.

    I will check with our Node.js developer to see if this was going to be addressed at all without the workaround. For sure, we do not recommend using QP2TERM or QSH for running interactive Node.js applications.

  2. John S Account Deactivated reporter

    Thanks and sorry for the late reply. The workaround has fixed the issue.

    My $0.02 worth on whether it should work with QP2TERM/QSH is it definitely should. I think node.js on IBM i should work with the native environments. Another issue if it doesn’t is, what would happen if I want to run this as a batch job on the system? It seems sensible that people may want to set up a process that is running in batch so IMO it needs to work with the native environments…

  3. Kevin Adler

    I believe that using QSH for batch is not affected by this problem so that should work. Regardless, we are working on a fix for usage within 5250 environments, though we still recommended to use SSH.

  4. Kevin Adler

    Node.js 12 RPMs since 12.8.1-1 are now patched to properly detect SSH/5250 environments so Node.js should no longer crash when run in QP2TERM or QSH, though you will still have the best supported environment through SSH.

  5. Log in to comment