针对不同Node.js版本编译的模块-SQLite3错误
我正在尝试在我的电子应用程序中使用SQLite3,但我不断收到错误-针对不同Node.js版本编译的模块-SQLite3错误,node.js,sqlite,electron,Node.js,Sqlite,Electron,我正在尝试在我的电子应用程序中使用SQLite3,但我不断收到错误- Uncaught Error: The module '\\?\\Desktop\Test\NHS-BDonor\node_modules\sqlite3\lib\binding\electron-v4.0-win32-x64\node_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 64. Thi
Uncaught Error: The module '\\?\\Desktop\Test\NHS-BDonor\node_modules\sqlite3\lib\binding\electron-v4.0-win32-x64\node_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:160:31)
at Module.load (internal/modules/cjs/loader.js:602)
at tryModuleLoad (internal/modules/cjs/loader.js:541)
at Function.Module._load (internal/modules/cjs/loader.js:533)
at Module.require (internal/modules/cjs/loader.js:640)
at require (internal/modules/cjs/helpers.js:20)
at Object.<anonymous> (\Desktop\Test\NHS-BDonor\node_modules\sqlite3\lib\sqlite3.js:4)
at Object.<anonymous> (\Desktop\Test\NHS-BDonor\node_modules\sqlite3\lib\sqlite3.js:190)
我在stackoverflow和youtube上尝试了许多解决方案,但似乎都没有奏效。对此问题的任何意见/帮助都将不胜感激。这似乎是electron builder的问题,请参阅
作为一种解决方法,我已将electron版本修改为4.0.3(最新的仍在运行的版本),但您也可以在提到的发行单中找到。相同的错误是时间剧透暂停获取信息。
{
"name": "App",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"postinstall": "electron-builder install-app-deps",
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "4.0.5",
"electron-builder": "^20.38.5"
},
"dependencies": {
"electron-rebuild": "^1.8.4",
"sqlite3": "^4.0.6",
"update-electron-app": "^1.3.0"
}
}