IBM/ibmi-oss-examples

Can't get npm odbc to install on IBMi 7.4

jared-draper opened this issue · 5 comments

When attempting to install the npm odbc on IBMi 7.4 it appears there might be a versioning issue. I followed the install instructions but when I attempt the npm install odbc it comes back with this:

-bash-4.4$ npm install odbc

odbc@2.3.5 install /home/DTJARED/odbctest/node_modules/odbc
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/markdirish/node-odbc/releases/download/v2.3.5/odbc-v2.3.5-aix-ppc64-napi-v3.tar.gz
node-pre-gyp WARN Pre-built binaries not found for odbc@2.3.5 and node@14.11.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: gmake
gyp ERR! stack at getNotFoundError (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:176:21)
gyp ERR! System OS400 7.4
gyp ERR! command "/QOpenSys/pkgs/lib/nodejs14/bin/node" "/QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node" "--module_name=odbc" "--module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /home/DTJARED/odbctest/node_modules/odbc
gyp ERR! node -v v14.11.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/QOpenSys/pkgs/lib/nodejs14/bin/node /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node --module_name=odbc --module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/DTJARED/odbctest/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System OS400 7.4
node-pre-gyp ERR! command "/QOpenSys/pkgs/lib/nodejs14/bin/node" "/home/DTJARED/odbctest/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/DTJARED/odbctest/node_modules/odbc
node-pre-gyp ERR! node -v v14.11.0
node-pre-gyp ERR! -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute '/QOpenSys/pkgs/lib/nodejs14/bin/node /QOpenSys/pkgs/lib/nodejs14/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3/odbc.node --module_name=odbc --module_path=/home/DTJARED/odbctest/node_modules/odbc/lib/bindings/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN odbctest@1.0.0 No description
npm WARN odbctest@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! odbc@2.3.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the odbc@2.3.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/DTJARED/.npm/_logs/2020-10-26T19_27_49_724Z-debug.log

Seems that there is no pre-built binary for this package on IBM i. You may need to install the GCC packages first to build it from source.

yum groups install "Development Tools"

I can get that prebuilt binary uploaded tomorrow. I've been putting it off for too long and it shouldn't be too difficult. Will post here when it's done.

@jared-draper There should now be a aix-ppc64 pre-built binary that was built-for and runs on IBM i. Node.js as IBM i identifies process.platform as aix, but I'm looking to see:

  1. What it would take to get an ibmi platform
  2. That this binary works on acutal AIX.

Ok thanks @markdirish !

I was following your session in TechU which led me here.

I was able to get it installed after installing the dev tools group but I think it would be nice to get the pre-builts out there.

Closing because pre-built binary is now available and @jared-draper was able to build after installing the development tools