4

I am attempting to begin writing a Node.JS Application that relies on some data stored in a DB2 database. I've come across two node modules that would work for me. DB2.js and ibm_db, both on the NPMjs site.

After following the install guides for both

https://github.com/herzi/db2.js

and

https://www.ibm.com/developerworks/community/blogs/pd/entry/using_ibm_db2_from_node_js4?lang=en

After following IBM's install guide for their module, I realized that I need to get the Linux drivers for DB2 installed. However, their instructions aren't very clear and have me install a new copy of node into my home folder. I have nodejs already installed globally and when I substitute it's install folder at /usr/lib/nodejs I still get compile errors when trying to do node-gyp configure build in either my clone of db2.js or ibm_db

The specific error I'm getting is related to some files that are supposed to get installed with the Linux DB2 drivers, namely sqlcli.h and sqlcli1.h. Here is the error message I get when running node-gyp configure build for either project.

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/home/mint/Programming/node-ibm_db/build'
  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
In file included from ../src/odbc.cpp:25:0:
../src/odbc.h:29:21: fatal error: sqlcli1.h: No such file or directory
 #include <sqlcli1.h>
                     ^
compilation terminated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
make: Leaving directory `/home/mint/Programming/node-ibm_db/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /home/mint/Programming/node-ibm_db
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

2 Answers 2

3

I think you need to install the IBM Data Server Client package for your version of the DB2 server -- it contains, in addition to the libraries, the header files required for compilation.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I just came across this post stackoverflow.com/questions/17960837/… which mentioned the header files as well. For some reason the developerworks post on IBM's site only said to get the data server driver, and not the client package, if this works I'll mark you as the correct answer
I guess they meant the precompiled ibm_db2 module, which wouldn't need headers, just the shared libraries.
1

Just run "npm install ibm_db" and you'll get those include files under ibm_db/installer/clidriver/include folder. Thanks.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.