Connect Local NodeJS Application to a Docker Oracle Database


This Content is from Stack Overflow. Question asked by Pedro Castro

I’m Trying to connect my local NodeJS application to my Oracle database which is in a Docker container. Here is my index.js

const express = require('express');
const oracledb = require('oracledb');
const app = express();

oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;

async function conexion(){
    let conexion;

        conexion = await oracledb.getConnection({
            user                :"myuser",
            password            :"123456",
            connectString       :"" //this is the IP of the docker container

        const data = await conexion.execute(
            'SELECT * FROM Pais',
    } catch(err){


var port = process.env.PORT || 8080 

console.log('API escuchando en el puerto ' + port)

But I get this error when running my NodeJS app:

API escuchando en el puerto 8080
Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: " cannot open shared object file: No such file or directory". See for help
Node-oracledb installation instructions:
You must have 64-bit Oracle Client libraries configured with ldconfig, or in LD_LIBRARY_PATH.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from

    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async conexion (/home/pedrocastro/Universidad/2S-2022/BASES1/Proyecto1_API/index.js:11:20) {
  errorNum: 0,
  offset: 0

How can I solve this??


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?