Error: DPI-1072: the Oracle Client library version is unsupported in nodejs

120 views Asked by At

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..

0

There are 0 answers