NPM install bug for pm2 on IBM i

triaged

(Liam Allan) #1

What I Wanted to Do

I was trying to install pm2 via npm on IBM i 7.3

What Happened Instead

2566 verbose stack Error: Unknown system error -64: Unknown system error -64, read
2566 verbose stack     at /QOpenSys/pkgs/lib/nodejs8/lib/node_modules/npm/node_modules/gentle-fs/lib/rm.js:245:7
2566 verbose stack     at /QOpenSys/pkgs/lib/nodejs8/lib/node_modules/npm/node_modules/gentle-fs/node_modules/iferr/index.js:13:50
2566 verbose stack     at /QOpenSys/pkgs/lib/nodejs8/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
2566 verbose stack     at FSReqWrap.oncomplete (fs.js:153:5)
2567 verbose cwd /home/liama
2568 verbose OS400 7.3
2569 verbose argv "/QOpenSys/pkgs/lib/nodejs8/bin/node" "/QOpenSys/pkgs/bin/npm" "i" "-g" "pm2"
2570 verbose node v8.14.0
2571 verbose npm  v6.4.1
2572 error code Unknown system error -64
2573 error Unknown system error -64: Unknown system error -64, read
2574 verbose exit [ 1, true ]

Reproduction Steps

  • Use an IBM i 7.3 system
  • Use nodejs8.ppc64 or nodejs10.ppc64 available via yum
  • Have *ALLOBJ authority on your user profile (just in case!)
  1. Sign into your IBM i via ssh
  2. use npm install -g pm2

Details

Note this was working about a month or two ago. Now it is not.

-64 is probably a system error number, which possibly corresponds to this:

-bash-4.4$ grep 64 /usr/include/errno.h 
#define EOPNOTSUPP      64      /* Operation not supported on socket */

This is also happening with npm install -g mocha as confirmed by @Musse at IBM. (edit: confirmed to be happening to all modules)

I should request that the IBM i team at IBM help look into this issue as it is urgent, specificlly @theprez and @Musse. Myself and others have clients waiting to upgrade to Node.js 8, but this is a major stopping point right now.

Platform Info

bash-4.4$ npm --versions
{ npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.33.0',
  node: '8.15.0',
  openssl: '1.0.2q',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.75',
  zlib: '1.2.11' }
bash-4.4$ node -p process.platform
aix

Thanks!


(Liam Allan) #2

Notes from Kevin Adler:

-bash-4.4$ /QOpenSys/pkgs/lib/nodejs8/bin/node -e "require('fs').readFileSync('.')"
fs.js:675
  return binding.read(fd, buffer, offset, length, position);
                 ^

Error: Unknown system error -64: Unknown system error -64, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:583:19)
    at [eval]:1:15
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:653:30)
    at evalScript (bootstrap_node.js:479:27)
    at startup (bootstrap_node.js:180:9)
-bash-4.4$ /QOpenSys/QIBM/ProdData/OPS/Node6/bin/node -e "require('fs').readFileSync('.')"
fs.js:733
  var r = binding.read(fd, buffer, offset, length, position);
                  ^

Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    at Object.fs.readSync (fs.js:733:19)
    at tryReadSync (fs.js:488:20)
    at Object.fs.readFileSync (fs.js:536:19)
    at [eval]:1:15
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.runInThisContext (vm.js:97:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:570:32)
    at evalScript (bootstrap_node.js:347:27)

Node 6 returns err.code with ‘EISDIR’, while Node 8 gives Unknown system error.

The problem is caused by a newer version of libuv that got pulled in via a Node update which removed a check for attempting to read a directory on AIX.


(Liam Allan) #3

IBM have applied a patch and ‘nodejs8.ppc64 0:8.15.0-1’ is now available via yum.

$ npm i -g mocha

+ mocha@5.2.0
$ npm i -g pm2

+ pm2@3.2.7

(Kat Marchán) #4

Looks like this was a node bug. Moved to #support, and it looks like it’s already been resolved.