找不到模块“oracledb”

问题描述 投票:0回答:3

npm start
产生

Error: Cannot find module 'oracledb'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)

我知道这是关于 PATH 的事情。我在 PATH 中按照出现的顺序设置了多个与 Oracle 相关的值:

1)

C:\oracle64\product\12.1.0.2\client_1\bin
instantclient 文件夹位于 client_1 级别,不在 bin 中。

2)

c:\oracle\ODP_home1;
instantclient 文件夹位于 oracle 文件夹中,名为
instantclient_12_1

3)

c:\oracle\instantclient_12_1
,似乎回答了第2点

4)

C:\Oracle\oledb\bin

Windows 7 64 位,npm 6.1.0。

npm install oracledb
得到

oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="59")
oracledb ERR! Failed to install binary package oracledb-v2.3.0-node-v59-win32-x64.gz
node.js oracle
3个回答
2
投票

这两个链接有助于解决问题

  1. Oracle自己的节点安装麻烦拍摄。
  2. 强制进行不安全安装,最终安装了2.2版而不是所谓的2.3版,现在运行正常。

0
投票

升级您的节点版本:v8.9.3

D:\stack>npm install oracledb

[电子邮件受保护] 安装 D:\stack ode_modules\oracledb 节点包/oracledbinstall.js

oracledb 开始安装 oracledb 验证安装 oracledb 继续安装 oracledb Oracledb 下载 oracledb 验证安装 oracledb 二进制 SHA 与 SHASUMS256.txt 中的 SHA 匹配 甲骨文数据库 甲骨文数据库 oracledb ** Node.js 8.9.3 的 Node-oracledb 2.3.0 安装完成(win32、 x64) 甲骨文数据库 ** oracledb ** 要使用已安装的node-oracledb: oracledb ** - 您的 PATH 环境中必须有 64 位 Oracle 客户端库 ent 变量 oracledb ** - 如果您还没有库,请安装 Instant Client B asic 或 Basic Light 包来自 oracledb ** http://www.oracle.com/technetwork/topics/winx64soft-089540.html oracledb ** - 适合您的 Oracle 的 Microsoft Visual Studio Redistributable 客户端库版本必须可用 oracledb ** 检查 https://oracle.github.io/node-oracledb/INSTALL.html 了解详细信息 伊尔斯 甲骨文数据库 ** oracledb ** Node-oracledb安装说明:https://oracle.github.io/no de-oracledb/INSTALL.html 甲骨文数据库 + [电子邮件受保护] 在 22.026 秒内添加 1 个包

我已成功 npm install oracledb。


0
投票

我发现这解决了 NextJS 13 中通过更新文件来更新文件的问题

next.config.mjs

const nextConfig = {
  webpack: (config) => {
    config.externals = {
      ...config.externals,
      knex: "commonjs knex",
    };

    return config;
  },
};
© www.soinside.com 2019 - 2024. All rights reserved.