ibmdb / node-ibm_db

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

Node ibm_db Installation Error with Python 3.12 #981

Closed phaviland closed 4 months ago

phaviland commented 5 months ago

I am receiving then following error when attempting to install ibm_db on a machine with python 3.12.1. It appears 'distutils' is removed in Python 3.12 which node-gyp has a fix for.

npm ERR! Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.16.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.12.1 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
npm ERR! ModuleNotFoundError: No module named 'distutils'
bimalkjha commented 5 months ago

@phaviland It is the issue with package node-gyp : https://github.com/nodejs/node-gyp/issues/2869 Seems node-gyp@10.0.1 has fixed the issue. Your node-gyp version is 9.3.1. Run npm install node-gyp@latest and then npm install ibm_db. It should fix the issue. Thanks.

phaviland commented 5 months ago

Thank you! This is resolved for me.