无法在Mac上安装节点oracle

时间:2014-12-03 15:00:22

标签: node.js oracle

我按照所有说明在我的计算机上安装node oracle。当我运行sudo npm install oracle(或没有sudo)时,我得到:

../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 14.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/alexanderkornhauser/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 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "oracle"
npm ERR! cwd /Users/alexanderkornhauser/Desktop
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

但我有occi.h文件。 我在网上搜了好几个小时都没有用。有什么想法吗?

2 个答案:

答案 0 :(得分:2)

自从我遇到这个问题以来,我发布了一笔赏金,但之后我就可以通过几个步骤解决它了。您需要导出变量,然后再执行一些项目。我在这里找到了oracle驱动程序的详细安装说明 - https://github.com/joeferner/node-oracle/blob/master/INSTALL.md

只需按照这些步骤进行操作即可。

答案 1 :(得分:0)

我遇到了同样的错误,我发现忘了安装Instant Client Package - SDK,其中包含额外的头文件和一个示例makefile,用于使用Instant Client开发Oracle应用程序。当我将sdk文件夹放到$ OCI_HOME(即instantclient_VV_v文件夹的路径)时,它已被解析。