【问题标题】:Error: NJS-045: cannot load the oracledb add-on binary for Node.js 10.17.0 (linux, x64)错误:NJS-045:无法为 Node.js 10.17.0(linux、x64)加载 oracledb 附加二进制文件
【发布时间】:2019-12-13 08:37:39
【问题描述】:

我正在将我的 aws lambda 函数从 8.11 更新到新的节点运行时 10.x。 为此,我将现有的 oracle 二进制文件 (node-oracledb 1.13.1) 更新为 (node-oracledb 4.1.0) 并将一个包发布到 npm 注册表中。更新 node-oracledb@4.1.0 后,当 lambda 函数之一尝试将数据插入 oracle db 时,我收到以下错误。

> "errorType": "Error",
>     "errorMessage": "NJS-045: cannot load the oracledb add-on binary for Node.js 10.17.0 (linux, x64)\nCannot load
> /var/task/node_modules/polaris-oracledbtest-4-lambda/build/Release/oracledb.node\nThe
> module
> '/var/task/node_modules/polaris-oracledbtest-4-lambda/build/Release/oracledb.node'\nwas
> compiled against a different Node.js version
> using\nNODE_MODULE_VERSION 57. This version of Node.js
> requires\nNODE_MODULE_VERSION 64. Please try re-compiling or
> re-installing\nthe module (for instance, using `npm rebuild` or `npm
> install`).\nNode-oracledb installation instructions:
> https://oracle.github.io/node-oracledb/INSTALL.html\nYou must have
> 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with
> ldconfig.\nIf you do not have Oracle Database on this computer, then
> install the Instant Client Basic or Basic Light package from
> \nhttp://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html\n",
>     "stack": [
>         "Error: NJS-045: cannot load the oracledb add-on binary for Node.js 10.17.0 (linux, x64)",
>         "Cannot load /var/task/node_modules/polaris-oracledbtest-4-lambda/build/Release/oracledb.node",
>         "The module '/var/task/node_modules/polaris-oracledbtest-4-lambda/build/Release/oracledb.node'",
>         "was compiled against a different Node.js version using",
>         "NODE_MODULE_VERSION 57. This version of Node.js requires",
>         "NODE_MODULE_VERSION 64. Please try re-compiling or re-installing",
>         "the module (for instance, using `npm rebuild` or `npm install`).",
>         "Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html",
>         "You must have 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.",
>         "If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from ",
>         "http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html",
>         "",
>         "    at Object.<anonymous> (/var/task/node_modules/polaris-oracledbtest-4-lambda/lib/oracledb.js:68:13)",
>         "    at Module._compile (internal/modules/cjs/loader.js:778:30)",
>         "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)",
>         "    at Module.load (internal/modules/cjs/loader.js:653:32)",
>         "    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)",
>         "    at Function.Module._load (internal/modules/cjs/loader.js:585:3)",
>         "    at Module.require (internal/modules/cjs/loader.js:692:17)",
>         "    at require (internal/modules/cjs/helpers.js:25:18)",
>         "    at Object.<anonymous> (/var/task/node_modules/polaris-oracledbtest-4-lambda/index.js:1:18)",
>         "    at Module._compile (internal/modules/cjs/loader.js:778:30)"
>     ]

【问题讨论】:

    标签: node-oracledb


    【解决方案1】:

    检查您是否确实干净地升级了 node-oracledb。错误消息来自NAN 时代(node-oracledb 4.0 之前),它导致 node-oracledb 二进制文件和 Node.js 版本之间的紧密耦合。这就是为什么您会收到有关 NODE_MODULE_VERSION 不兼容的消息的原因。在 node-oracledb 4 中,实现改为使用 N-API,它允许一个 node-oracledb 二进制文件与多个 Node.js 版本一起使用。

    【讨论】:

      猜你喜欢
      • 2019-12-12
      • 2018-11-14
      • 2018-10-03
      • 2023-03-31
      • 2022-12-19
      • 2020-01-15
      • 2021-01-13
      • 2020-05-18
      • 2020-10-07
      相关资源
      最近更新 更多