We are trying to install the node module oracledb
on an Amazon Elastic Beanstalk instance.
We can get oracledb
working fine locally, and we have gotten to the point where the Beanstalk instance installs instantclient via the rpms. What we are stuck on now is that npm install
expects to either use LD_LIBRARY_PATH
or for instantclient to be in /opt/oracle/instantclient
. Currently, the rpms install it to /usr/lib/oracle/12.1/client64
It seems that there are two possible solutions:
- Get the rpm to install the instantclient to
/opt/oracle/instantclient
or move it / link it after the fact - Set the
LD_LIBRARY_PATH
environment variable so thatnpm install
knows to use instantclient from/usr/lib/oracle/12.1/client64
We don't know how to do either of these things properly in a Beanstalk configuration, though.
I can't find any information on when a Beanstalk instance actually runs npm install
and we are not telling it to do so explicitly, but it is running.
Changing environment variables through environment properties as the documentation suggests here does not work. Seemingly these are only set when the server actually runs as in
LD_LIBRARY_PATH=x node app.js
They are not used for npm install
.
How can we update our elastic beanstalk configuration to either put the instantclient where we want it or set LD_LIBRARY_PATH
during npm install?