IBM / node-odbc

ODBC bindings for node
MIT License
146 stars 77 forks source link

[BUG] npm i odbc for Node 18 fails on IBM i 7.5 #328

Closed GuriCat closed 1 year ago

GuriCat commented 1 year ago

Cannot install odbc for Node 18. (also failed on Node 14, etc.)

bash-5.1$ yum install unixODBC unixODBC-devel
ibmi-base                                                                         | 3.6 kB  00:00:00
ibmi-release                                                                      | 2.9 kB  00:00:00
bash-5.1$ node -v
v18.14.1
bash-5.1$ npm -v
9.3.1
bash-5.1$ npm install odbc
npm ERR! code 1
npm ERR! path /home/GURI/node_modules/odbc
npm ERR! command failed
.~~~~~
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/GURI/.npm/_logs/2023-04-21T02_17_39_075Z-debug-0.log

Node18_2023-04-21T02_17_39_075Z-debug-0.log

Additional info:

  1. Will feedback to Ryver (https://ibmioss.ryver.com/index.html#posts/3261853).
  2. "itoolkit" can be installed without problem.
bash-5.1$ npm install itoolkit

up to date, audited 74 packages in 2m

5 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
bash-5.1$ npm list
guri@1.0.0 /home/GURI
├── idb-connector@1.2.18
└── itoolkit@1.0.1
kadler commented 1 year ago

This is a compatibility problem with GCC 6 on IBM i 7.4 and up. Please install the gcc10-cplusplus package and try again with CC=gcc-10 CXX=g++-10 npm install odbc

GuriCat commented 1 year ago

Thank you very much for your reply. I received similar error.

bash-5.1$ CC=gcc-10 CXX=g++-10 npm install odbc
npm ERR! code 1
npm ERR! path /QOpenSys/pkgs/lib/nodejs16/bin/node_modules/odbc
npm ERR! command failed

It seems like my IBM i cannot connect to github.com... investigating.

npm ERR! node-pre-gyp ERR! install request to https://github.com/markdirish/node-odbc/releases/download/v2.4.7/odbc-v2.4.7-aix-ppc64-napi-v6.tar.gz failed, reason: read ECONNRESET
GuriCat commented 1 year ago

Problem was solved I think. My IBM i could not reach IP address of github.com suggested by our DNS. I add different IP address for github.com by CFGTCP -> Opt.10 and "npm i odbc" worked.

bash-5.1$ system ping github.com
(github.com is reachable)
bash-5.1$ npm i odbc

added 2 packages, removed 1 package, and audited 76 packages in 25s

5 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.