ibmdb / node-ibm_db

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

Error in installing ibm_db #428

Closed pnsrinivasreddy closed 6 years ago

pnsrinivasreddy commented 6 years ago

Hi, I am getting the below error in mac while doing "npm install ibm_db". Absolutely no clue as I am a UI developer.

Nagas-MacBook-Pro:lib nagasrinivasa$ npm install ibm_db

ibm_db@2.4.0 install /usr/local/lib/node_modules/ibm_db node installer/driverInstall.js

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% | 20080158 bytes downloaded out of 20080158 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 ...

CXX(target) Release/obj.target/odbc_bindings/src/odbc.o

{ Error: Command failed: node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME" xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

../src/odbc.cpp:210:15: warning: 'Call' is deprecated [-Wdeprecated-declarations] data->cb->Call(1, info); ^ ../node_modules/nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here NAN_DEPRECATED inline v8::Local ^ ../node_modules/nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'

define NAN_DEPRECATED attribute((deprecated))

                                   ^

../src/odbc.cpp:217:80: error: no matching member function for call to 'NewInstance' Local js_result = Nan::New(ODBCConnection::constructor)->NewInstance(2, info);


/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate function not viable: requires single argument 'context', but 2 arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../src/odbc.cpp:222:15: warning: 'Call' is deprecated [-Wdeprecated-declarations]
    data->cb->Call(2, info);
              ^
../node_modules/nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/odbc.cpp:262:78: error: no matching member function for call to 'NewInstance'
  Local<Object> js_result = Nan::New<Function>(ODBCConnection::constructor)->NewInstance(2, params);
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate function not viable: requires single argument 'context', but 2 arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
                                           ^
../src/odbc.cpp:1194:7: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  cb->Call(1, info);
      ^
../node_modules/nan/nan.h:1617:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local<v8::Value>
  ^
../node_modules/nan/nan.h:98:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
../src/odbc.cpp:1258:87: error: too few arguments to function call, expected 2, have 1
      objError->SetPrototype(Exception::Error(Nan::New(errorMessage).ToLocalChecked()));
      ~~~~~~~~~~~~~~~~~~~~~~                                                          ^
/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8.h:3308:3: note: 'SetPrototype' declared here
  V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
  ^
/Users/nagasrinivasa/.node-gyp/10.0.0/include/node/v8config.h:410:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
3 warnings and 3 errors generated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 17.6.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=/usr/local/lib/node_modules/ibm_db/installer/clidriver"
gyp ERR! cwd /usr/local/lib/node_modules/ibm_db
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

    at ChildProcess.exithandler (child_process.js:282:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:947:16)
    at Socket.stream.socket.on (internal/child_process.js:368:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close [as _onclose] (net.js:598:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ibm_db@2.4.0 install: `node installer/driverInstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ibm_db@2.4.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/nagasrinivasa/.npm/_logs/2018-07-14T18_11_39_997Z-debug.log
rhtpandeyIN commented 6 years ago

Hi, you are getting this error because of the node.js version, currently node-ibm_db does not support node.js version 10 on Mac OS, please use node < 10.X. Thanks. Our team is working on this issue, very soon we will release the compatible version with node 10.X

pnsrinivasreddy commented 6 years ago

Thank so much. It helped me.

kbosshardt commented 6 years ago

Hello. I am also getting this issue. However, node -v shows: v8.11.2

rhtpandeyIN commented 6 years ago

Hi @kbosshardt , Can you please attach the error log, also, mention the platform name.

thomblweed commented 6 years ago

Hello. I am also getting this issue. However, node -v shows: v8.11.2

Me too with v8.9.4

rhtpandeyIN commented 6 years ago

Is this on Mac? Would you be able to paste the output and error log?

kbosshardt commented 6 years ago

Yes this is on a Mac.

ibm_db@2.4.1 install /Users/kbossha@us.ibm.com/Desktop/SkillsProject/MVP2/sc_skillsproject/node_modules/ibm_db node installer/driverInstall.js

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% | 20080158 bytes downloaded out of 20080158 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" xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last): File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in sys.exit(gyp.script_main()) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 545, in script_main return main(sys.argv[1:]) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 538, in main return gyp_main(args) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py", line 523, in gyp_main generator.GenerateOutput(flat_list, targets, data, params) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput part_of_all=qualified_target in needed_targets) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write self.Pchify)) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources cflags = self.xcode_settings.GetCflags(configname) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags archs = self.GetActiveArchs(self.configname) File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs xcode_archs_default = GetXcodeArchsDefault() File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault xcodeversion, = XcodeVersion() File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion version = re.match(r'(\d.\d.?\d*)', version).groups()[0] AttributeError: 'NoneType' object has no attribute 'groups' 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:336:16) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Darwin 17.7.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/../Desktop/SkillsProject/MVP2/sc_skillsproject/node_modules/ibm_db/installer/clidriver" gyp ERR! cwd /Users/../Desktop/SkillsProject/MVP2/sc_skillsproject/node_modules/ibm_db gyp ERR! node -v v8.11.2 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok

at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)

killed: false, code: 1, signal: null, cmd: 'node-gyp configure build --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ibm_db@2.4.1 install: node installer/driverInstall.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ibm_db@2.4.1 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/../.npm/_logs/2018-10-10T14_47_15_765Z-debug.log

kbosshardt commented 6 years ago

Do you want the debug log?

thomblweed commented 6 years ago

mine is same error as @kbosshardt with the node version difference

rhtpandeyIN commented 6 years ago

@kbosshardt , I think this error is coming due to this - xcode-select: error: tool 'xcodebuild' requires Xcode.

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

thomblweed commented 6 years ago

I tried again after following instructions at https://github.com/nodejs/node-gyp/issues/569 with same error happening with npm install

rhtpandeyIN commented 6 years ago

@kbosshardt , @thomblweed, I think you need to install "Command line tools" (that is xcode - if you haven't already).

Following are few links which will help you to install it: https://github.com/nodejs/node-gyp/issues/569 https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error

I am sorry, but this issue is not related to node-ibm_db. Still, let us know the steps how you resolved this error, it can help others.

thomblweed commented 6 years ago

OK thanks will continue investigating other options as neither of those work for me. Many thanks for your help.

kbosshardt commented 6 years ago

Interesting. I have installed ibm_db before without having Xcode.

rhtpandeyIN commented 6 years ago

@kbosshardt , Well, that's not a node-ibm_db requirement, it's node-gyp's. Check if it's working after downgrading node-gyp version.

kbosshardt commented 6 years ago

Installing Xcode seemed to do the trick.

kbosshardt commented 6 years ago

Oh I see. They must have updated their dependencies recently.