I ran into this because I unzipped/extracted the directories into two separate places.
The directory structure should be listed as so:
Where sometpathname is the same pathname:
/somepathname/instantclient
/somepathname/instantclient/sdk
@timschambers having them separate works for me. What error were you getting?
cjones@cjones-mac:~/n$ (export OCI_LIB_DIR=/Users/cjones/instantclient_11_2_basic_only; export OCI_INC_DIR=/Users/cjones/instantclient_11_2_sdk_only/sdk/include; npm install ./oracledb/)
> [email protected] install /Users/cjones/n/node_modules/oracledb
> node-gyp rebuild
CXX(target) Release/obj.target/oracledb/src/njs/src/njsOracle.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsPool.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsConnection.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsResultSet.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsMessages.o
CXX(target) Release/obj.target/oracledb/src/njs/src/njsIntLob.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnv.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiEnvImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiException.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiExceptionImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiConnImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiDateTimeArrayImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiPoolImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiStmtImpl.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiUtils.o
CXX(target) Release/obj.target/oracledb/src/dpi/src/dpiLob.o
SOLINK_MODULE(target) Release/oracledb.node
[email protected] node_modules/oracledb
└── [email protected]
cjones@cjones-mac:~/n$
[email protected] install /somelongobscurepathnamethatineedtoobfuscate/node_modules/oracledb
node-gyp rebuild
node-oracledb ERR! Error: Cannot find Oracle client header files.
node-oracledb ERR! Error: See https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx
gyp: Call to 'INSTURL="https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instosx"; ERR="node-oracledb ERR! Error:"; if [ -z $OCI_INC_DIR ]; then if [ -f /opt/oracle/instantclient/sdk/include/oci.h ]; then echo "/opt/oracle/instantclient/sdk/include/"; else echo "$ERR Cannot find Oracle client header files." >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; else if [ -f "$OCI_INC_DIR/oci.h" ]; then echo $OCI_INC_DIR; else echo "$ERR Cannot find \$OCI_INC_DIR/oci.h" >&2; echo "$ERR See $INSTURL" >&2; echo "" >&2; fi; fi;' returned exit status 0. while trying to load binding.gyp
I debugged this with Dan Mcghan and make sure the sdk was sub-dir of instant client was the fix.
@timschambers I need some more detail about how you installed Instant Client and what you set the OCI_*_DIR variables to. As I showed, the Basic & SDK packages do not need to be in the same directory. Having said that, the first sentence of 5.3 does say "install them into the same directory:" since this makes the auto-discovery of /opt/oracle/instantclient work. If this doc instruction about using the same dir is too hidden at the end of a sentence, or a concrete example of the expected dir structure will help, I can see how the doc can be improved. At the moment I just have your output and no understanding of the scenario you're trying to help other people avoid.
Closing due to lack of feedback.
I had the same issue. Setting Env variable works for me.
$ export OCI_LIB_DIR=/home/gdev/Software/instantclient_12_1
$ export OCI_INC_DIR=/home/gdev/Software/instantclient_12_1/sdk/include
$ npm install oracledb
Most helpful comment
I had the same issue. Setting Env variable works for me.
$ export OCI_LIB_DIR=/home/gdev/Software/instantclient_12_1
$ export OCI_INC_DIR=/home/gdev/Software/instantclient_12_1/sdk/include
$ npm install oracledb