【问题标题】:I have a better_sqlite3.node error when i require quick.db当我需要 quick.db 时出现 better_sqlite3.node 错误
【发布时间】:2021-10-22 17:41:51
【问题描述】:

我在安装时没有错误,但是当我在 main.js 中需要 quick.db 时(它是 v12 中的 discord.js 机器人)

const db = require('quick.db')

我的终端出现better_sqlite3.node错误

-C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:121
        throw e;
        ^

Error: The module '\\?\C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\build\Release\better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at bindings (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\bindings\bindings.js:112:48)
    at Object.<anonymous> (C:\Users\Fatsah\Desktop\Wizzy Bot\node_modules\better-sqlite3\lib\database.js:9:24)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_DLOPEN_FAILED'
}
PS C:\Users\Fatsah\Desktop\Wizzy Bot> 

我尝试重新安装 node.js 并将其更新到上次测试中

节点版本:v16.7.0

Discord.js:v12.5.3

Npm 版本:7.20.3

不久前我有这个错误,当我使用 node v14 时,我对 canvas / canvacord 也有同样的错误,但是是 canvas.node

【问题讨论】:

    标签: javascript node.js discord.js quick.db better-sqlite3


    【解决方案1】:

    重新安装你所有的依赖,你可能在安装better-sqlite3之后升级了Node,你需要重新重建库。

    【讨论】:

      猜你喜欢
      • 2014-03-21
      • 2023-03-23
      • 1970-01-01
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 2011-08-07
      • 2021-06-11
      • 2023-03-13
      相关资源
      最近更新 更多