For quite some time I've been using a version of this script to install node-oracledb 1.6 on my Mac. Now with Mojave, this script is no longer working.
https://blogs.oracle.com/opal/installing-node-oracledb-on-os-x-with-oracle-instant-client-11204
https://gist.github.com/brandonaaskov/978bfd5711a64df22be6
The script succeeds until the npm install oracledb line.
console.log(process.version)? Is it 64-bit or 32-bit: use console.log(process.arch)? node -v: v4.8.7 (x64)
npm -v 2.15.11
console.log(oracledb.versionString)?1.6
npm install oracledb within shell script linked above.
logged in as administrator.
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the
libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from ../src/njs/src/njsOracle.cpp:53:
In file included from ../src/njs/src/njsOracle.h:56:
../node_modules/nan/nan.h:50:10: fatal error: 'algorithm' file not found
#include <algorithm>
console.log(process.platform)?darwin, mac OS 10.14.2
console.log(oracledb.oracleClientVersionString)? Is it 64-bit or 32-bit? How was it installed? Where is it installed?x64.
instantclient-sdk-macos.x64-11.2.0.4.0.zip
instantclient-basic-macos.x64-11.2.0.4.0.zip
from here:
https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
console.log(connection.oracleServerVersionString)?11.2 (I believe).
PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) set to? On macOS, what is in ~/lib?No such file or directory on macOS.
Per the script above, only.
The shell script above.
Is there a way to pass '-std=libc++' to npm within that shell script? Nothing I've tried is working.
Thank you!
Try setting these before installing:
export CXXFLAGS="-mmacosx-version-min=10.9"
export LDFLAGS="-mmacosx-version-min=10.9"
For me on High Sierra: with these set:
$ otool -L node_modules/oracledb/build/Release/oracledb.node
node_modules/oracledb/build/Release/oracledb.node:
@rpath/libclntsh.dylib.12.1 (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
The default without them set:
$ otool -L node_modules/oracledb/build/Release/oracledb.node
node_modules/oracledb/build/Release/oracledb.node:
@rpath/libclntsh.dylib.12.1 (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 795.0.0)
With later versions of node (or node-gyp), libc++ seems to have become used by default.
Wow, today I learned that those flags start with "mmac...", not "mac...".
I inserted those before the npm install oracledb line, and it's building now! Thank you!
Great! I'll close this.
Most helpful comment
Try setting these before installing:
For me on High Sierra: with these set:
The default without them set:
With later versions of node (or node-gyp), libc++ seems to have become used by default.