Search code examples
node.jsherokunpmnode-oracledb

How can I install the OracleDB NPM package on a Heroku NodeJS server?


I have a NodeJS server running on Heroku and I'm trying to install the oracledb package(https://www.npmjs.com/package/oracledb) to my server's node_modules when pushing to Heroku.

When pushing to Heroku I am getting this error when the oracledb package is attempted to be installed: "node-oracledb ERR! Error: Cannot find Oracle library libclntsh.so". The full error output I am getting from the Heroku push can be seen here: https://gist.github.com/AkyunaAkish/89a4283cc2da32e26fece617d4138ce0

I tried following this repo's readme to install addons that I thought would help but that didn't seem to make a difference: https://github.com/MichaelBuhler/heroku-buildpack-nodejs-oracledb

I then went to the node-oracledb repository and attempted to follow their instructions for installing oracledb on Linux(by using Heroku run bash and then running the commands) although that didn't work because yum is not available and the file system is read-only; https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instlinux

I don't need to host an oracledb instance in my heroku environment, I just need to install the package into my node_modules in order to use my database-driver to connect to a remote oracledb being hosted elsewhere.

Any suggestions as to how to setup the environment properly for my needs would be appreciated, thanks.

FYI: I asked Heroku support and was told it's not an issue that falls within the nature of the Heroku Support policy so here I am.


Solution

  • I had problems trying to install oracledb on my Heroku too with the same approach. I forked that and changed some things, including how the script got the instantclient libs and have success installing now. Please check my fork here: https://github.com/pupostd/heroku-buildpack-nodejs-oracledb.git