0


i want to know is there any way to connect node js with oracle db. I am trying to connect nodejs with oracle db by using node module require('oracledb') but its not working as expected.

var oracledb = require('oracledb');
oracledb.getConnection({
    user          : "*******",
    password      : "*******",
    connectString : "192.168.177.106/mymmsrev-local"
  },function(err, connection){
    if (err) { 
        console.error(err);
        return;
    }
});

Getting below Error:

    D:\projects\ImportExport\node_modules\oracledb\lib\oracledb.js:65
      throw new Error(nodbUtil.getErrorMessage('NJS-045', nodeInfo));
      ^

Error: NJS-045: cannot load the oracledb add-on binary for Node.js 8.9.4 (win32, x64)
Node.js require() error was:
  DPI-1047: 64-bit Oracle Client library cannot be loaded: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help
Node.js require() mapped to D:\projects\ImportExport\node_modules\oracledb\build\Release\oracledb.node
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle client libraries in your PATH environment variable.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available.
2
  • What is the error? Commented Jan 9, 2019 at 12:39
  • Question updated. Commented Jan 9, 2019 at 12:44

2 Answers 2

1

You may try to run: npm rebuild oracledb

If it not work, try to have a look here https://github.com/oracle/node-oracledb/issues/577

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

Comments

1

It appears the answer is in your error message. As often happens, you need some Oracle client libraries which you can download freely from the Oracle site (also see the link in the error message).

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.