简体   繁体   中英

Node.js ibm_db installation error on CentOS

I'm making a simple app with angular and nodeJS, and need to connect to DB2 to access some procedures. The nodeJS server is installed in a Centos 6.5 server machine, but when I tried to install ibm_db using npm it showed some kind of error, started with

{ [Error: Command failed: In file included from ../src/odbc.h:23,
                 from ../src/odbc.cpp:25:

and ended with some kind of GYP error.

> 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.emit (events.js:98:17)
> gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
> gyp ERR! System Linux 2.6.32-504.el6.x86_64
> gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IBM_DB_HOME=/var/www/html/m-siam/trunk/server/node_modules/ibm_db/installer/clidrive
> gyp ERR! cwd /var/www/html/m-siam/trunk/server/node_modules/ibm_db
> gyp ERR! node -v v0.10.36
> gyp ERR! node-gyp -v v0.10.6

gyp ERR! not ok

And when I tried to run the nodeJS server, it showed 'could not load the bindings file' error.

How do I install this module properly? I'm using nodeJS 0.10.36 and installing both ibm_db version 0.0.8 (the one coming from package.json) and version 0.0.10 result in the same error.

Somehow, my colleague was able to install ibm_db module on another nodeJS directory. Maybe my app's directory dress is too long, I don't know, but I just copied the module from my colleague's directory to my own, and it now works perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM