CraZySacX / node-jdbc

JDBC Wrapper for node.js
140 stars 106 forks source link

Error When Installing on Mac #226

Open daffigusti opened 2 years ago

daffigusti commented 2 years ago

Hello, I got error when installing node-jdbc on my Mac. The error after running command npm i --save jdbc

npm i --save jdbc npm ERR! code 1 npm ERR! path /Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/java npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@14.17.0 | darwin | x64 npm ERR! gyp info find Python using Python version 3.9.8 found at "/usr/local/opt/python@3.9/bin/python3.9" npm ERR! gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/java/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/Users/daffigusti/Library/Caches/node-gyp/14.17.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/daffigusti/Library/Caches/node-gyp/14.17.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/daffigusti/Library/Caches/node-gyp/14.17.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/java', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! Debugger listening on ws://127.0.0.1:59694/c3770860-c7a3-4a90-9d5e-5f37c34ed9bf npm ERR! For help, see: https://nodejs.org/en/docs/inspector npm ERR! Debugger attached. npm ERR! Waiting for the debugger to disconnect... npm ERR! gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error:gyp` failed with exit code: 1 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/node-gyp/lib/configure.js:351:16) npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:376:20) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) npm ERR! gyp ERR! System Darwin 21.1.0 npm ERR! gyp ERR! command "/Users/daffigusti/.nvm/versions/node/v14.17.0/bin/node" "/Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /Users/daffigusti/development/tmmin-valuechain/tmmin-agent-vc/node_modules/java npm ERR! gyp ERR! node -v v14.17.0 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /Users/daffigusti/.npm/_logs/2021-11-23T01_25_41_094Z-debug.log`

Anyone knows this issue ? Plz help

YangAi commented 2 years ago

You need to reset $JAVA_HOME variables.

Check this page:

https://stackoverflow.com/questions/39428191/jni-h-file-not-found-installing-node-java-module-on-os-x-el-capitan