$ source pre_install_check.sh everythings looks dandy OCI_HOME: /Users/X/Documents/projects/X/instantclient_11_1 OCI_LIB_DIR: /Users/X/Documents/projects/X/instantclient_11_1 OCI_INCLUDE_DIR: /Users/X/Documents/projects/X/instantclient_11_1/sdk/include
$ npm install oracle npm WARN package.json X@0.1.0 No repository field.
oracle@0.3.7 install /Users/X/Documents/projects/X/node_modules/oracle node-gyp rebuild
CXX(target) Release/obj.target/oracle_bindings/src/connection.o
In file included from …/src/connection.cpp:2:
…/src/connection.h:11:10: fatal error: ‘occi.h’ file not found
#include <occi.h>
^
1 error generated.
make: *** [Release/obj.target/oracle_bindings/src/connection.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command “node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /Users/X/Documents/projects/X/node_modules/oracle
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! oracle@0.3.7 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oracle@0.3.7 install script.
npm ERR! This is most likely a problem with the oracle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls oracle
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.4.0
npm ERR! command “node” “/usr/local/bin/npm” “install” "oracle"
npm ERR! cwd /Users/X/Documents/projects/X/instantclient_11_1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
$ ls $OCI_INCLUDE_DIR ldap.h occiControl.h ociap.h ocikpr.h orid.h nzerror.h occiData.h ociapr.h ocixmldb.h orl.h nzt.h occiObjects.h ocidef.h ocixstream.h oro.h occi.h oci.h ocidem.h odci.h ort.h occiAQ.h oci1.h ocidfn.h oratypes.h xa.h occiCommon.h oci8dp.h ociextp.h ori.h
$ ls $OCI_LIB_DIR
BASIC_README libnnz11.dylib ojdbc6.jar
adrci libocci.dylibgenezi libocci.dylib.11.1
sdk libclntsh.dylib libociei.dylib uidrvci
libclntsh.dylib.11.1 libocijdbc11.dylib xstreams.jar
libnnz.dylib ojdbc5.jar
附带链接 node-oracle node-oracle
你是用官方的吗?
- Installation
The basic install steps are:
Install the small, free Oracle Instant Client libraries if your database is remote, or have a local database such as the free Oracle XE release. Run npm install oracledb to install from the NPM registry. See INSTALL for details.
@coolicer 我是按照https://www.npmjs.com/package/oracle这个来的 刚找到https://github.com/joeferner/node-oracle/issues/166 说是 不能在sudo下面执行,但是我得环境不sudo 完全npm install不了
看上去是oracle client没安装好还是没配置好,官方的叫oracledb貌似
已经解决,谢谢大家。https://github.com/joeferner/node-oracle/issues/254 这篇帖子