node-db-oracle icon indicating copy to clipboard operation
node-db-oracle copied to clipboard

Error: Unable to load shared library /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node

Open ghost opened this issue 13 years ago • 2 comments

This seem to be an ongoing problem. I follow all the steps as described in https://github.com/mariano/node-db-oracle/ Environment variables are set as descirbed:

OCI_INCLUDE_DIR=/opt/instantclient/sdk/include LD_LIBRARY_PATH=/opt/instantclient OCI_LIB_DIR=/opt/instantclient

and

NODE_PATH=/usr/share/npm/node_modules

I was able to build successfully:

/usr/share/npm/node_modules $ sudo npm install db-oracle npm http GET http://registry.npmjs.org/db-oracle npm http 200 http://registry.npmjs.org/db-oracle npm http GET http://registry.npmjs.org/db-oracle/-/db-oracle-0.2.3.tgz npm http 200 http://registry.npmjs.org/db-oracle/-/db-oracle-0.2.3.tgz

[email protected] install /usr/share/npm/node_modules/db-oracle node-waf configure build

Checking for program g++ or c++ : /usr/bin/g++ Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for g++ : ok
Checking for node path : not found Checking for node prefix : ok /usr Checking for header occi.h : yes Checking for library occi : yes 'configure' finished successfully (0.604s) Waf: Entering directory /usr/share/npm/node_modules/db-oracle/build' [ 1/12] cxx: lib/node-db/binding.cc -> build/Release/lib/node-db/binding_1.o [ 2/12] cxx: lib/node-db/connection.cc -> build/Release/lib/node-db/connection_1.o [ 3/12] cxx: lib/node-db/events.cc -> build/Release/lib/node-db/events_1.o [ 4/12] cxx: lib/node-db/exception.cc -> build/Release/lib/node-db/exception_1.o [ 5/12] cxx: lib/node-db/query.cc -> build/Release/lib/node-db/query_1.o [ 6/12] cxx: lib/node-db/result.cc -> build/Release/lib/node-db/result_1.o [ 7/12] cxx: src/connection.cc -> build/Release/src/connection_1.o [ 8/12] cxx: src/oracle.cc -> build/Release/src/oracle_1.o [ 9/12] cxx: src/query.cc -> build/Release/src/query_1.o [10/12] cxx: src/result.cc -> build/Release/src/result_1.o [11/12] cxx: src/oracle_bindings.cc -> build/Release/src/oracle_bindings_1.o [12/12] cxx_link: build/Release/lib/node-db/binding_1.o build/Release/lib/node-db/connection_1.o build/Release/lib/node-db/events_1.o build/Release/lib/node-db/exception_1.o build/Release/lib/node-db/query_1.o build/Release/lib/node-db/result_1.o build/Release/src/connection_1.o build/Release/src/oracle_1.o build/Release/src/query_1.o build/Release/src/result_1.o build/Release/src/oracle_bindings_1.o -> build/Release/oracle_bindings.node Waf: Leaving directory/usr/share/npm/node_modules/db-oracle/build' 'build' finished successfully (1.532s) [email protected] ./db-oracle

everything looks great. I run my node js script and I get:

$ node SDPServer.js

node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Unable to load shared library /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node at Object..node (module.js:472:11) at Module.load (module.js:348:32) at Function._load (module.js:308:12) at Module.require (module.js:354:17) at require (module.js:370:17) at /usr/share/npm/node_modules/db-oracle/db-oracle.js:18:15 at Module._compile (module.js:412:14) at Object..js (module.js:459:10) at Module.load (module.js:348:32) at Function._load (module.js:308:12)

Note that the script contains the sample code you posted:

var oracle = require('db-oracle');

new oracle.Database({ hostname: '173.4.4.4', user: 'dasfdsfasd', password: 'dsfsdafsd', database: 'sdafasdfsd' }).connect(function(error) { if (error) { return console.log("CONNECTION ERROR: " + error); }

this.query().select('*').from('Devices').execute(function(error, rows) {
    if (error) {
        return console.log('ERROR: ' + error);
    }
    console.log(rows.length + ' ROWS');
});

});

Now if cat the file: /usr/share/npm/node_modules/db-oracle/build/Release/oracle_bindings.node it does exist with some content. The db-oracle directory structure looks like this:

/usr/share/npm/node_modules/db-oracle $ tree . ├── build │   ├── c4che │   │   ├── build.config.py │   │   └── Release.cache.py │   ├── config.log │   └── Release │   ├── lib │   │   └── node-db │   │   ├── binding_1.o │   │   ├── connection_1.o │   │   ├── events_1.o │   │   ├── exception_1.o │   │   ├── query_1.o │   │   └── result_1.o │   ├── oracle_bindings.node │   └── src │   ├── connection_1.o │   ├── oracle_1.o │   ├── oracle_bindings_1.o │   ├── query_1.o │   └── result_1.o ├── db-oracle.js ├── lib │   └── node-db │   ├── binding.cc │   ├── binding.h │   ├── connection.cc │   ├── connection.h │   ├── events.cc │   ├── events.h │   ├── exception.cc │   ├── exception.h │   ├── node_defs.h │   ├── query.cc │   ├── query.h │   ├── README.md │   ├── result.cc │   ├── result.h │   └── tests.js ├── oracle-test-async.js ├── oracle-test.js ├── package.json ├── README.md ├── src │   ├── connection.cc │   ├── connection.h │   ├── oracle_bindings.cc │   ├── oracle.cc │   ├── oracle.h │   ├── query.cc │   ├── query.h │   ├── result.cc │   └── result.h ├── testing │   ├── test │   └── test.cc ├── tests.js └── wscript

10 directories, 48 files

So ... I lost a day here so far .... I read similar posts and pretty much have everything that has been suggested. Seems like it is complaining not finding something that clearly exists. Any advice here in how to move forward ??

Thanks

ghost avatar Aug 02 '12 00:08 ghost

Did you compile with node v0.8? node-db-oracle is not yet compatible with node v0.8.x branch (use node v0.6.x instead).

dgrelaud avatar Aug 07 '12 07:08 dgrelaud

When can I use with node v0.8.x?

likdike avatar Aug 21 '12 08:08 likdike