ibmdb / node-ibm_db

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

Bug Report: node-gyp configure build fails with python errors #910

Closed egriff38 closed 1 year ago

egriff38 commented 1 year ago

ibm_db@3.1.0 install /Users/egriff38/Kollacode/edit/backend/node_modules/ibm_db node installer/driverInstall.js

platform = darwin, arch = x64, node.js version = v14.21.3 make version =GNU Make 3.81 IBM_DB_HOME environment variable have already set to -> /Applications/dsdriver

Downloading of clidriver skipped - build is in progress...

Error: Command failed: node-gyp configure build --IS_DOWNLOADED=false --IBM_DB_HOME="$IBM_DB_HOME" Traceback (most recent call last): File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in sys.exit(gyp.script_main()) ^^^^^^^^^^^^^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 554, in script_main return main(sys.argv[1:]) ^^^^^^^^^^^^^^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 547, in main return gyp_main(args) ^^^^^^^^^^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 520, in gyp_main [generator, flat_list, targets, data] = Load( ^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 136, in Load result = gyp.input.Load(build_files, default_variables, includes[:], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load LoadTargetBuildFile(build_file, data, aux_data, File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile build_file_contents = open(build_file_path, 'rU').read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12) gyp ERR! System Darwin 22.3.0 gyp ERR! command "/Users/egriff38/.nvm/versions/node/v14.21.3/bin/node" "/Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=false" "--IBM_DB_HOME=/Applications/dsdriver" gyp ERR! cwd /Users/egriff38/Kollacode/edit/backend/node_modules/ibm_db gyp ERR! node -v v14.21.3 gyp ERR! node-gyp -v v5.1.1 gyp ERR! not ok

at ChildProcess.exithandler (child_process.js:383:12)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1088:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5) {

killed: false, code: 1, signal: null, cmd: 'node-gyp configure build --IS_DOWNLOADED=false --IBM_DB_HOME="$IBM_DB_HOME"' } npm WARN backend@1.0.0 No description npm WARN backend@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ibm_db@3.1.0 install: node installer/driverInstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ibm_db@3.1.0 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/egriff38/.npm/_logs/2023-03-14T13_51_06_319Z-debug.log

bimalkjha commented 1 year ago

@egriff38 This issue is due to old version on node-gyp package that comes with npm. We can see node-gyp -v v5.1.1 in the shared output. Latest version of node-gyp package is v9.3.1. This issue is fixed in latest version of node-gyp package. Probably your system has old version of npm installed and you need to upgrade npm using command npm install npm@latest -g. Please check output of npm -v command. The latest version of npm is 9.6.1. After updating npm, cd to /Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm and check output of npm ls node-gyp command. If you see version of node-gyp is older, then run below commands:

cd /Users/egriff38/.nvm/versions/node/v14.21.3/lib/node_modules/npm
npm install node-gyp@latest

Now, you should be able to install ibm_db. Thanks.

egriff38 commented 1 year ago

That worked, thanks. Not entirely sure how the npm version reverted, but installing the latest version did fix it.

kirrg001 commented 1 year ago

I had to downgrade from python 3.11 to 3.10, see.