1
votes

i have problem with 'node-oracledb' library.its a simple file which try to connect to the local database. the environment : centos 6.4 / nodejs v0.12.2 / the oracle library node-oracledb 0.3.8 environment variables from .bash_profile:

export ORACLE_BASE=/usr/oracle/app export ORACLE_SID=orcl export ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1 export OCI_LIB_DIR=$ORACLE_HOME/lib export OCI_INC_DIR=$ORACLE_HOME/rdbms/public LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

var oracle = require('oracle');

    var connectData = {
        hostname: "localhost",
        port: 1521,
        database: "orcl", // System ID (SID)
        user: "scott",
        password: "oracle"
                 }

errors: .Error: Cannot find module '../build/Release/oracle_bindings' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/usr/oracle/dev/atlantisSGBD/node_modules/oracle/lib/oracle.js:2:16) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17)

1

1 Answers

0
votes

It looks like you are using the unmaintained oracle module. You might consider switching to Oracle's oracledb module instead.

If that's not a viable solution: The module it is having trouble finding (oracle_bindings) appears to be installed via gyp in the installation process for oracle. So try installing it again and take special note if that piece succeeds or not.

Moreover, note that the installation instructions for oracle are more extensive than the typical Node.js module. Make sure you have all the environment variables set that it requires and that they are set to the correct values. (In your code, check the values in the process.env object.) Make sure you have successfully installed everything the instructions require you to have installed.