Hi All,
Finally managed to get the system to install without errors after upgrading the GCC compiler on redhat and setting the GCC path. Its all in the default locations using the RPM installers, for reasons beyond my control I am running this entirely as the root user (not using sudo). When trying to access the module I get a libmql1.so: cannot open shared object file: No such file or directory not sure what its looking for or how to point it in the direction. Can you help?
This is my output from an npm install oracledb just for evidence.
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
-
> [email protected] install /root/oracletest/node_modules/oracledb
> node-gyp rebuild
make: Entering directory `/root/oracletest/node_modules/oracledb/build'
CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsResultSet.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsIntLob.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiLob.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiCommon.o
SOLINK_MODULE(target) Release/obj.target/oracledb.node
COPY Release/oracledb.node
make: Leaving directory `/root/oracletest/node_modules/oracledb/build'
[email protected] node_modules/oracledb
芒芒芒 [email protected]
Then running this:
var oracledb = require('oracledb');
I get this:
Error: libmql1.so: cannot open shared object file: No such file or directory
at Error (native)
at Object.Module._extensions..node (module.js:434:18)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/root/oracletest/node_modules/oracledb/lib/oracledb.js:32:19)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
I don't recognize that lib. What does ldd libclntsh.so* show?
If you're not using Instant Client RPMs try setting RPATH=1 when installing node-oracledb to make sure all Oracle libraries are found.
Any chance you can upgrade the OS so you don't need to install a new compiler?
Cheers @cjbj
At first it showed nothing so I searched the system and found it in
/usr/lib/oracle/12.1/client64/lib/libclntsh.so
Tried adding the path using ldconfig -n
ldconfig -n /usr/lib/oracle/12.1/client64/lib
Which solved not being able to find the primary library, but then I had bigger problems because
libmql1.so was missing. It lives in the same folder as libclntsh.so. It should have been found by the ldconfig.
By adding the path to the environment variable LD_LIBRARY_PATH i was able to have it run:
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH
Heh; I've been converted to a Mac OS X guy and hadn't remembered that that lib got added to the Linux 12.1 client. Funny there were next to no google hits on it. And funny about ldconfig, and that the default rpath with node-oracledb didn't work.
It seems you are OK so I will close this now.
By adding the path to the environment variable LD_LIBRARY_PATH i was able to have it run:
how exactly do I do it? I am on Ubuntu. Thanks
ok so
sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig
did the trick
Most helpful comment
ok so
sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf" sudo ldconfigdid the trick