ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
192 stars 150 forks source link

Error on npm install #767

Closed finbarc closed 3 years ago

finbarc commented 3 years ago

Hi - I'm getting an error trying to perform an npm install of ibm_db - please see output from npm install below and I've attached the npm debug log file.

I've tried a few different versions of npm and ibm_db with the same issue.

Please let me know if you need any more information

ibm_db@2.7.2 install /Users/n0147401/git/messaging-opt-in-api/node_modules/ibm_db node installer/driverInstall.js

platform = darwin , arch = x64 , node.js version = v14.16.0 make version = GNU Make 3.81 Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

100.00% | 30120620 bytes downloaded out of 30120620 bytes.


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 undefined 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.


Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

Error: Command failed: node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME" No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected! gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/n0147401/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) gyp ERR! System Darwin 19.6.0 gyp ERR! command "/Users/n0147401/.nvm/versions/node/v14.16.0/bin/node" "/Users/n0147401/.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/Users/n0147401/git/messaging-opt-in-api/node_modules/ibm_db/installer/clidriver" gyp ERR! cwd /Users/n0147401/git/messaging-opt-in-api/node_modules/ibm_db gyp ERR! node -v v14.16.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe.<anonymous> (net.js:673:12) {

killed: false, code: 1, signal: null, cmd: 'node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' } npm WARN eslint-plugin-import@2.18.0 requires a peer of eslint@2.x - 6.x but none is installed. You must install peer dependencies yourself. npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ibm_db@2.7.2 install: node installer/driverInstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ibm_db@2.7.2 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! /Users/n0147401/.npm/_logs/2021-05-17T15_25_25_560Z-debug.log

2021-05-17T15_25_25_560Z-debug.log

bimalkjha commented 3 years ago

@finbarc See below error in your install output:

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
gyp ERR! configure error

So, you need to install Xcode on your macos to install ibm_db. Xcode comes with c++ compilers which is required to compile ibm_db native source code during install time. Thanks.

finbarc commented 3 years ago

Thanks @bimalkjha - that worked - you can close this.

finbarc commented 3 years ago

Hi - I have another issue if that's OK.

I was able to connect to the database locally etc. but on commit I'm seeing the following error:

/Users/n0147401/git/messaging-opt-in-api/node_modules/bindings/bindings.js:121 throw e; ^ Error: The module '/Users/n0147401/git/messaging-opt-in-api/node_modules/ibm_db/build/Release/odbc_bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)

I've tried npm rebuild and npm install without any success. I'm using node v14.16.0 which I think is what NODE_MODULE_VERSION 83 refers to and also ibm_db v2.7.3.

Thanks for any help!

bimalkjha commented 3 years ago

@finbarc Normally this error comes when you are using ibm_db under electron app, please confirm. Electron uses specific version of node.js. In that case, you should use "npm install --vscode" under ibm_db. Thanks.

bridgettepepper commented 3 years ago

Hi @bimalkjha - Forgive me for the dumb question, I'm a relatively new developer. I have the same issue stated above when I try and npm install ibm_db in my node.js/Vue.js app. I am working on a Mac OS with node version - v10.24.1.

You mentioned the fix was to install 'Xcode' - can you please provide me with instructions on how to install this? I am working in VSCode. Is it an npm install Xcode? And do you install in my Node project folder?


My error message is below in case my lack of development knowledge is seeing something else. I appreciate your help!!

`bridgette.pepper@ibm.com@Bridgettes-MacBook-Pro node-vue-w3id-master % npm install ibm_db 

> ibm_db@2.7.3 install /Users/bridgette.pepper@ibm.com/Downloads/node-vue-w3id-master/node_modules/ibm_db
> node installer/driverInstall.js

platform =  darwin , arch =  x64 , node.js version =  v10.24.1
make version = GNU Make 3.81
Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

100.00% | 30120620 bytes downloaded out of 30120620 bytes.

****************************************
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 undefined   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.
****************************************

Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

{ Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 20.4.0
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=/Users/bridgette.pepper@ibm.com/Downloads/node-vue-w3id-master/node_modules/ibm_db/installer/clidriver"
gyp ERR! cwd /Users/bridgette.pepper@ibm.com/Downloads/node-vue-w3id-master/node_modules/ibm_db
gyp ERR! node -v v10.24.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:198:13)
    at Pipe._handle.close (net.js:607:12)
  killed: false,
  code: 1,
  signal: null,
  cmd:
   'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' }
npm WARN node-vue-oidc@0.0.0 No repository field.
npm WARN node-vue-oidc@0.0.0 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.7.3 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ibm_db@2.7.3 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!     /Users/bridgette.pepper@ibm.com/.npm/_logs/2021-05-18T21_18_08_673Z-debug.log
bridgette.pepper@ibm.com@Bridgettes-MacBook-Pro node-vue-w3id-master % npm install node-vue-oidc
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/node-vue-oidc - Not found
npm ERR! 404 
npm ERR! 404  'node-vue-oidc@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
`
finbarc commented 3 years ago

@bridgettepepper you can get XCode in the mac app store.

finbarc commented 3 years ago

@bimalkjha - thanks for your response - I'm not using electron - I managed to get this to work using node 12 (I'd prefer node 14 if possible but can leave this for now).

The next problem I'm having (please let me know if you'd prefer separate issues for these) is when it's deployed and running I'm getting the error:

libcrypt.so.1: cannot open shared object file: No such file or directory

This is running in an AWS lambda. Should this be possible? Do I need to install something else to make this work?

Thanks again for your help!

bimalkjha commented 3 years ago

@finbarc You need to install openssl package on AWS lambda. Similar issue is discussed here: https://forums.aws.amazon.com/thread.jspa?threadID=247288 Check it and try. Thanks.

nsdnl commented 2 years ago

Hi @bimalkjha . i have the same setup with aws lambda and i am getting the error: libcrypt.so.1: cannot open shared object file: No such file or directory I tried reaching above thread (https://forums.aws.amazon.com/thread.jspa?threadID=247288) but it seems it has been archived. can you help me here?