Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing node-oracledb 1.6 on Mojave #1021

Closed
sanfords opened this issue Dec 9, 2018 · 3 comments
Closed

Installing node-oracledb 1.6 on Mojave #1021

sanfords opened this issue Dec 9, 2018 · 3 comments

Comments

@sanfords
Copy link

sanfords commented Dec 9, 2018

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.

Answers to questions:

  1. What is your Node.js version: use 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
  1. What is your node-oracledb version: use console.log(oracledb.versionString)?
1.6
  1. What exact command caused the problem (e.g. what command did you try to install with)? Who were you logged in as?
npm install oracledb within shell script linked above.

logged in as administrator.
  1. What error(s) you are seeing?
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>
  1. What OS (and version) is Node.js executing on: use console.log(process.platform)?
darwin, mac OS 10.14.2
  1. What is your Oracle client (e.g. Instant Client) version: use 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
  1. What is your Oracle Database version: use console.log(connection.oracleServerVersionString)?
11.2 (I believe).
  1. What is the 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.
  1. What Oracle environment variables did you set? How exactly did you set them?
Per the script above, only.
  1. Do you have a small, single Node.js script that immediately runs to show us the problem?
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!

@cjbj
Copy link
Member

cjbj commented Dec 9, 2018

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.

@sanfords
Copy link
Author

sanfords commented Dec 9, 2018

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!

@cjbj
Copy link
Member

cjbj commented Dec 10, 2018

Great! I'll close this.

@cjbj cjbj closed this as completed Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants