How to install nodejs6 on i with new ACS or non-ACS ibm repo options?

Issue #120 resolved
Dale Asher created an issue

We had existing nodejs6 applied prior to OS upgrade (from now deprecated 5733OPS Lic Pgm options). Our development team somehow uninstalled the Node6 version and we require it for customer support of existing products.
The review of existing packages available using new ACS or Non-ACS options (https://bitbucket.org/ibmi/opensource/src/master/docs/yum/)) appear to support only Node version 8 or higher.
1 - Is there an available package for nodejs6.ppc64 (e.g. node v6 version of .rpm like nodejs8-8.14.0-1.ibmi7.2.ppc64.rpm) that could be added to a local ibm repo on the i for OS V7R3 or V7R4 to support installation using yum on i with or without ACS?

~~

Workarounds attempted:
2 - I’ve also attempted to use nvm on i, but have not been able to work through issues with certificates.

a - On one system (V7R3), stalled with failure to pull nvm from github. Error is: error:10072065:elliptic curve routines:EC_POINT_copy:incompatible objects

GIT_SSL_NO_VERIFY=true git clone https://github.com/nvm-sh/nvm.git .nvm
Cloning into '.nvm'...
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/': error:10072065:elliptic curve routines:EC_POINT_copy:incompatible objects

b - On another system (V7R2), able to pull and install nvm, but unable to resolve the nvm.sh use of curl (required ‘-k’ to use curl)

3 - Attempts to use aix package from Nodejs so far have been unsuccessful. Is there any advice for installation of 'non-IBM' packages or repackaging for use as 'IBM RPM' for i that can be provided?

Last errors below from attempt on V7R4

cd /opt
wget --no-check-certificate https://nodejs.org/dist/v6.11.5/node-v6.11.5-aix-ppc64.tar.gz
VERSION=v6.11.5
DISTRO=aix-ppc64
gunzip -c node-$VERSION-$DISTRO.tar.gz | tar -xvf-
gcc 4.8.3 installed on IBMi
cd /QOpenSys/opt/node-v6.11.5-aix-ppc64/bin
node -v

exec(): 0509-036 Cannot load program node because of the following errors:
0509-150 Dependent module /opt/freeware/lib/libstdc+.a(libstdc+.s
o.6) could not be loaded.
0509-103 *The module has an invalid magic number*.

Researched ‘magic number’ issue and trying:

cd /QOpenSys/opt/freeware/lib
rm libstdc++.a
rm libgcc_s.a
ln -s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.3/ppc64/libstdc++.a libstdc++.a
ln -s /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.3/ppc64/libgcc_s.a libgcc_s.a
cd /QOpenSys/opt/node-v6.11.5-aix-ppc64/bin
node -v
   exec(): 0509-036 Cannot load program node because of the following errors:   
           0509-150   Dependent module libperfstat.a(shr_64.o) could not be loaded.                                                                          
           0509-022 Cannot load module libperfstat.a(shr_64.o).                 
           0509-026 System error: A file or directory in the path name does not exist. 

Comments (4)

  1. Jesse G

    Unfortunately, the only ways I could think of a success path for you would be to either put 5733OPS back and run with it, or create a tarball from the 5733OPS node binaries and put the resulting files somewhere (which would of course involve installing 5733OPS to make the initial tarball). Of course, this is a fully unsupported state, but such would be true for any node 6 (or 8 ) deployment at this point.

    nvm won’t work because those versions of Node.js didn’t have IBM i changes upstreamed to GitHub.

    AIX builds won’t work because, as you have discovered, AIX links to libraries that we don’t have, and also won’t have IBM i-specific code built in. In general, running RPMs from AIX is an endeavor with very low success rates.

    Do you have any information on what is requiring Node version 6 specifically? The Node.js team strives to maintain backward compatibility, so your application is likely to run without issue on Node.js version 12. It may be a more painless path to pursue testing and support of your products on a supported version of Node.js.

  2. Dale Asher reporter

    Thx, Jesse.

    I feared nvm may be a dead end - thx for confirming.

    The last three versions of one of our products was developed using Nodejs6. Our next release running with version 10 of Nodejs isn’t due to ship until June and I’m trying to support some customers trying to install or upgrade our product without 5733OPS installed (with the option 10 for Node version 6).

    Running our app in version 8 or higher hits a snag with module compatibility that we cannot patch prior to our next release:

    Error: 0509-022 Cannot load module /Aldon/aldonlmw/opsportal-3.4.0/node_modules/node-expat/build/Release/node_expat.node.
    0509-103 The module has an invalid magic number.
    

    We were trying to find a way to manually install the older version to support the new installations or upgrade prior to our next release that will run in version 10.

    Best,

    d

  3. Kevin Adler

    Ah, looks like the old module is 32-bit, which makes sense since OPS software was all 32-bit. Can’t use 32-bit node modules on a 64-bit node, so it looks like your only option here is to install and use Node 6 from OPS.

  4. Log in to comment