0

I'm trying to connect to the external oracle database using nodejs. Have installed basic package oracle instantclient_19_8 for macOS. Followed this article: https://developers.ascendcorp.com/how-to-install-oracle-instant-client-on-apple-silicon-m1-24b67f2dc743 and could connect to the db by sqlplus. But when I run the following code in my server.js file I'm getting error: Error: DPI-1072: the Oracle Client library version is unsupported.

const oracledb = require('oracledb');

let clientOpts = {};
if (process.platform === 'darwin' && process.arch === 'x64') {
    clientOpts = { libDir: process.env.HOME + '/Downloads/instantclient_19_8' };
}

oracledb.initOracleClient(clientOpts);

async function run() {
    const connection = await oracledb.getConnection({
        user          : "username",
        password      : "password",
        connectString : "host:1521/service_name"
    });

    const result = await connection.execute(`SELECT EMBOSSEDNAME FROM SBNS_PAYMENT_CARD`);
    console.log("Result is:", result.rows);

    await connection.close();
}

run();

I'm using macOS Ventura 13.4 M1 Apple Chip. Both nodejs and oracle client are 64bit.

I need to connect db so I could use urungi (https://urungi.readthedocs.io/en/latest/). First time using oracle. Seems like I'm doing something wrong..

MT0
  • 143,790
  • 11
  • 59
  • 117
iroda
  • 1
  • Follow [How to Install node-oracledb 5.5 and Oracle Database on Apple M1/M2 Silicon](https://medium.com/oracledevs/how-to-install-node-oracledb-5-5-and-oracle-database-on-apple-m1-m2-silicon-941fccda692f). Since node-oracledb 6 is out, just use 6 where the post mentions 5.5. – Christopher Jones Jun 15 '23 at 20:39

0 Answers0