【问题标题】:Cannot install node oracle on Mac无法在 Mac 上安装节点 oracle
【发布时间】:2014-12-03 15:00:22
【问题描述】:

我按照所有说明在我的计算机上安装节点 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 文件。 我已经在网上搜索了几个小时无济于事。有什么想法吗?

【问题讨论】:

  • 您是否按照安装指南进行操作? github.com/joeferner/node-oracle#basic-installation
  • 我一个字一个字地跟着它
  • 当您在 shell 中键入 $ printenv$ sudo printenv 时,是否表明 OCI_INCLUDE_DIROCI_LIB_DIR 已设置且正确?
  • 我应该寻找什么?我收到很多文本...唯一的外壳是:SHELL=/bin/bash
  • 首先,你不应该真的需要使用sudo。实际上,您可能会以这种方式搞砸,因为某些文件会以错误的权限创建(并且您会遇到更多错误)。我建议更改整个目录的所有权并在此之后停止使用sudo(不需要它)。要更改当前目录的所有权(递归),请运行 sudo chown -R &lt;username&gt; . 并在您的系统用户名中使用 sub。其次...

标签: node.js oracle


【解决方案1】:

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

只要按照这些一步一步来,你应该会很好。

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • 对于没有看过的人,oracle 包已被oracledb 包所取代。
    猜你喜欢
    • 2021-04-17
    • 2023-03-25
    • 1970-01-01
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 2019-10-17
    • 1970-01-01
    • 2020-04-22
    相关资源
    最近更新 更多