node.jsmacosdb2ibm-db2

npm install ibm_db2 is failing (need to use db2 database using nodejs)


In my project we have Db2 database which we need to connect using nodejs. I went through ibm_db2 blog however not able to install ibm_db2 module. Seems like I need to install IBM Data Server driver which seems not available on Mac (I am using Mac Yosemite for development). I am getting following error when i tried "npm install ibm_db2"

bash-3.2$ npm install ibm_db
\
> ibm_db@0.0.8 install 

/user/test/jumpstart/node_modules/ibm_db

node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: getaddrinfo ENOTFOUND
    at errnoException (dns.js:37:11)
    at Object.onanswer [as oncomplete] (dns.js:124:16)

npm ERR! ibm_db@0.0.8 install: `node installer/driverInstall.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the ibm_db@0.0.8 install script.
npm ERR! This is most likely a problem with the ibm_db package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node installer/driverInstall.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls ibm_db
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "ibm_db"
npm ERR! cwd /user/test/jumpstart
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Even I tried to delete "node_modules" folder and tried again but faced same proble.

Please help.


Solution

  • ibm_db@0.0.8 node_modules/ibm_db ├── bindings@1.0.0 ├── fstream@1.0.4 (inherits@2.0.1, graceful-fs@3.0.6, mkdirp@0.5.0, rimraf@2.3.2) ├── tar.gz@0.1.1 (commander@1.1.1, tar@0.1.20, fstream@0.1.31) └── unzip@0.1.11 (setimmediate@1.0.2, readable-stream@1.0.33, match-stream@0.0.2, pullstream@0.4.1, binary@0.3.0, fstream@0.1.31)

    Have you tried recently? It is working fine for me on mac. You may want to submit issue report to ibm_db. My mac version is OS X yosemite 10.10.2

    Are you using 64 bit node.j or 32 bit node.js? I am using 64 bit node.j