Installing node-oracledb on OS X with Oracle Instant Client

----> This note and script is obsolete. The current node-oracledb OS X install instructions contain nicer solutions <----- . I've been hacking an Apple OS X shell script to install node-oracledb. You tell it where your Instant Client libraries and headers ZIP packages are. It then installs node-oracledb, resulting in an instantclient directory and a node_modules directory. This automates the instructions Node-oracledb Installation on OS X with Instant Client. My script can be seen here. [Now removed] I was investigating how to avoid needing to set DYLD_LIBRARY_PATH. I wanted to find how to replicate the use of rpath, which is available for node-oracledb on Linux. A standard install on OS X needs DYLD_LIBRARY_PATH set, otherwise Node.js will fail with the error: cjones@cjones-mac:~/n$ node select1.js /Users/cjones/n/node_modules/oracledb/lib/oracledb.js:28 throw err; ^ Error: dlopen(/Users/cjones/n/node_modules/oracledb/build/Release/oracledb.node, 1): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 Referenced from: /Users/cjones/n/node_modules/oracledb/build/Release/oracledb.node Reason: image not found at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/Users/cjones/n/node_modules/oracledb/lib/oracledb.js:23:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) So, I was playing with to see how to circumvent this. Before running, edit it and set the paths to where the Instant Client 'basic' and 'sdk' ZIP files are located on your filesystem, see IC_BASIC_ZIP and IC_SDK_ZIP. (You can download Instant Client from OTN. Use the 64-bit packages). You also specify the target application directory you are using, see TARGET_DIR. This is where the components are installed into. Update https_proxy if you are behind a firewall, otherwise comment it out. If you have various node_modules directories around, then npm might end up installing oracledb in an unexpected place and the script will error. The key bit of that I was interested in is: # For Oracle Instant Client these are the default paths we will change IC_DEF1=/ade/b/3071542110/oracle/rdbms/lib IC_DEF2=/ade/dosulliv_ldapmac/oracle/ldap/lib . . . # Warning: work in progress - may not be optimal chmod 755 $OCI_LIB_DIR/*dylib $OCI_LIB_DIR/*dylib.11.1 install_name_tool -id libclntsh.dylib.11.1 $OCI_LIB_DIR/libclntsh.dylib.11.1 install_name_tool -change $IC_DEF2/libnnz11.dylib $OCI_LIB_DIR/libnnz11.dylib \ $OCI_LIB_DIR/libclntsh.dylib.11.1 install_name_tool -id libnnz11.dylib $OCI_LIB_DIR/libnnz11.dylib install_name_tool -change $IC_DEF1/libclntsh.dylib.11.1 \ $OCI_LIB_DIR/libclntsh.dylib.11.1 $OCI_LIB_DIR/libociei.dylib install_name_tool -change $IC_DEF1/libclntsh.dylib.11.1 \ $OCI_LIB_DIR/libclntsh.dylib.11.1 $NODE_ORACLEDB_LIB chmod 555 $OCI_LIB_DIR/*dylib $OCI_LIB_DIR/*dylib.11.1 This changes the library install and identification names using install_name_tool. Note this tool cannot allocate more space for path names than currently exists. My code is a work in progress; I may work out a better way, perhaps using libtool. Comments & suggestions welcome. The script does more than most people probably need. In future even I might only run parts extracted from it. If you are new to node-oracledb, check out its install and API documentation on GitHub. You may also be interested in reading The Easiest Way to Install Oracle Database on Mac OS X.

Monday, July 27, 2015 | node.js | Read More

node-oracledb 0.7.0 now supports Result Sets and REF CURSORS

A new release of the Node.js driver for Oracle Database is now on and GitHub. node-oracledb 0.7 connects Node.js 0.10, Node.js 0.12, and io.js to Oracle Database. It runs on a number of platforms. For more information about node-oracledb see the node-oracledb GitHub page. The changes in 0.7 are: Added result set support for fetching large data sets. Rows from queries can now be fetched in batches using a ResultSet class. This allows large query results to be...

Monday, July 20, 2015 | node.js | Read More

Python cx_Oracle 5.2 driver for Oracle Database has been released

Anthony Tuininga just released an updated Python cx_Oracle 5.2 driver for Oracle Database. This release brings a number of enhancements, many of them for Oracle Database 12c features such as longer VARCHARS. cx_Oracle 5.2 is the first release Oracle has contributed code for (thanks Avinash!) so we're pretty happy all around. And a big thank you to all the other contributors and users who have made this release possible. The new code features are: Support for Oracle Database 12c...

Monday, June 22, 2015 | python | Read More

Scripting Languages & Oracle: Blogs to Follow

If you haven't come across them, keep an eye on the blogs of Blaine Carter and Dan McGhan. They will be posting mostly on developing with Python and Javascript, respectively. Blaine & Dan work at Oracle under the leadership of Steven Feuerstein who is well known in the Oracle PL/SQL world for his enthusiasm for application development.

Wednesday, June 17, 2015 | General | Read More

node-oracledb 0.6.0 is on NPM (Node.js driver for Oracle Database)

Node-oracledb 0.6.0 is now out on NPM. The Oracle Database Node.js driver powers high performance Node.js applications. There is one feature change in this release: node-oracledb now builds with Node.js 0.10, 0.12 and with io.js. Huge thanks to Richard Natal for his GitHub pull request that added support. For more information about node-oracledb see the node-oracledb GitHub page.

Tuesday, May 26, 2015 | node.js | Read More

node-oracledb 0.5.0 is on NPM (Node.js driver for Oracle Database)

It's been a long time between drinks so we are bringing out the 0.5.0 Preview Release version of the Node.js driver for Oracle Database, warts and all. Changed the isAutoCommit attribute name to autoCommit. Changed the isExternalAuth attribute name to externalAuth. These two small attribute name changes break backwards compatibility with node-oracledb 0.4.2. A simple search and replace in your code base is all that is needed to migrate to 0.5.0. We wanted to make these changes...

Friday, May 8, 2015 | node.js | Read More

Visit the Oracle Blog


Contact Us


Integrated Cloud Applications & Platform Services