ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
190 stars 151 forks source link

Error on NPM install. #843

Closed IvonTarazona closed 2 years ago

IvonTarazona commented 2 years ago

Hi, I'm getting an error installing ibm_db package.

I've tried with node 14 and the same result.

(I was able to install it by downgrading my node version to 10 but node >=13 is needed).

Let me know if you need additional information

OUTPUT

2022-04-11T18:27:24.1763684Z Step 19/22 : RUN npm install --unsafe-perm ibm_db 2022-04-11T18:27:24.2205748Z ---> Running in d897e5a830eb 2022-04-11T18:27:34.9022156Z > ibm_db@2.8.1 install /usr/src/app/node_modules/ibm_db 2022-04-11T18:27:34.9022723Z > node installer/driverInstall.js 2022-04-11T18:27:34.9886231Z platform = linux, arch = x64, node.js version = v13.14.0 2022-04-11T18:27:34.9933752Z make version =GNU Make 4.2.1 2022-04-11T18:27:35.0648914Z 2022-04-11T18:27:35.0650017Z **** 2022-04-11T18:27:35.0651728Z You are downloading a package which includes the Node.js module for IBM DB2/Informix. The module is licensed under the Apache License 2.0. The package also includes IBM ODBC and CLI Driver from IBM, which is automatically downloaded as the node module is installed on your system/device. The license agreement to the IBM ODBC and CLI Driver is available in /usr/src/app/node_modules/ibm_db/installer/clidriver. Check for additional dependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If you do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device. 2022-04-11T18:27:35.0653346Z **** 2022-04-11T18:27:35.0653486Z 2022-04-11T18:27:35.0653912Z Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz ... 2022-04-11T18:27:35.0654202Z 2022-04-11T18:27:35.6663387Z 2022-04-11T18:27:35.6672164Z 0.03% | 8192 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:35.7238948Z 0.07% | 16384 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:35.7240785Z 0.10% | 24576 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:35.7811997Z 0.13% | 32768 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:35.7813308Z 0.16% | 40960 bytes downloaded out of 25012651 bytes. ... ...

2022-04-11T18:27:39.5698932Z 99.96% | 25001984 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:39.5699629Z 99.99% | 25010176 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:40.5367271Z 100.00% | 25012651 bytes downloaded out of 25012651 bytes. 2022-04-11T18:27:40.5367593Z 2022-04-11T18:27:40.5367888Z Downloading and extraction of DB2 ODBC CLI Driver completed successfully. 2022-04-11T18:27:40.5368087Z 2022-04-11T18:27:41.7017593Z 2022-04-11T18:27:41.7051181Z Error: Command failed: node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME" 2022-04-11T18:27:41.7055463Z gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp 2022-04-11T18:27:41.7056623Z gyp ERR! configure error 2022-04-11T18:27:41.7057124Z gyp ERR! stack Error: gyp failed with exit code: 1 2022-04-11T18:27:41.7058462Z gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) 2022-04-11T18:27:41.7059424Z gyp ERR! stack at ChildProcess.emit (events.js:315:20) 2022-04-11T18:27:41.7060156Z gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) 2022-04-11T18:27:41.7061181Z gyp ERR! System Linux 4.14.186-146.268.amzn2.x86_64 2022-04-11T18:27:41.7062511Z gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/usr/src/app/node_modules/ibm_db/installer/clidriver" 2022-04-11T18:27:41.7063666Z gyp ERR! cwd /usr/src/app/node_modules/ibm_db 2022-04-11T18:27:41.7064355Z gyp ERR! node -v v13.14.0 2022-04-11T18:27:41.7065031Z gyp ERR! node-gyp -v v5.1.0 2022-04-11T18:27:41.7065383Z gyp ERR! not ok 2022-04-11T18:27:41.7065657Z 2022-04-11T18:27:41.7066082Z at ChildProcess.exithandler (child_process.js:303:12) 2022-04-11T18:27:41.7066864Z at ChildProcess.emit (events.js:315:20) 2022-04-11T18:27:41.7067421Z at maybeClose (internal/child_process.js:1026:16) 2022-04-11T18:27:41.7068023Z at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { 2022-04-11T18:27:41.7068549Z killed: false, 2022-04-11T18:27:41.7068883Z code: 1, 2022-04-11T18:27:41.7069263Z signal: null, 2022-04-11T18:27:41.7070104Z cmd: 'node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' 2022-04-11T18:27:41.7070608Z }

bimalkjha commented 2 years ago

@IvonTarazona The above error gyp: Call to 'node -e "require('nan')"' tells that gyp is unable to find the nan module. Seem you are using Amazon Linux, so as per ibm_db documentation- For Docker Linux Container: make sure you have installed make, gcc, g++(gcc-c++), python2.7 and node before installing ibm_db. For root user, usenpm install --unsafe-perm ibm_dbto install ibm_db.

If you are root user, then try command: npm install --unsafe-perm ibm_db Make sure g++ is installed in the system. Install node-gyp and nan packages before installation of ibm_db. Thanks.