简体   繁体   English

将 sqlite3 添加到 Electron-forge 应用程序后,应用程序将不再运行

[英]After adding sqlite3 to Electron-forge app, app wont run anymore

i am trying to integrate sqlite3 into my electron-forge application.我正在尝试将 sqlite3 集成到我的电子锻造应用程序中。 But whatever I try it always fails.但无论我尝试什么,它总是失败。 I have tried我试过了

  1. using "scripts": {"postinstall": "install-app-deps",}使用"scripts": {"postinstall": "install-app-deps",}
  2. installing it with npm install sqlite3 --build-from-source使用npm install sqlite3 --build-from-source安装它
  3. using electron-rebuild like so "scripts": {"rebuild": "electron-rebuild -f -w sqlite3"}像这样使用电子重建"scripts": {"rebuild": "electron-rebuild -f -w sqlite3"}

all of the above came from some post somewhere where people would have issues in using sqlite3 in conjunction with electron-forge.以上所有内容都来自某个地方的某个帖子,人们在将 sqlite3 与电子锻造结合使用时会遇到问题。 Now the problem is that after I did any if the above mentioned things when I try to run my app I get the following (edited paths)现在的问题是,当我尝试运行我的应用程序时,如果我做了上述任何事情,我会得到以下(编辑路径)

An unhandled error has occurred inside Forge:
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu erm�glichen, m�ssen Sie den Schalter "/m" hinzuf�gen.
  unpack_sqlite_dep
  sqlite3.c
  win_delay_load_hook.cc
  sqlite3.vcxproj -> C:\...\angular\node_modules\sqlite3\build\Release\\sqlite3.lib
  database.cc
  node_sqlite3.cc
  statement.cc
  win_delay_load_hook.cc
..\src\database.cc(49): warning C4996: 'Nan::MakeCallback': was declared deprecated [C:\...\angular\node_modules\sqlite3\build\node_sqlite3.vcxproj]
  C:\...\angular\node_modules\sqlite3\node_modules\nan\nan.h(929): note: see declaration of 'Nan::MakeCallback'

And a ton more like these warnings.还有很多更像这些警告。

And somewhere in between all these warnings I actualy get one error:在所有这些警告之间的某个地方,我实际上收到了一个错误:

C:\...\.electron-gyp\.node-gyp\iojs-3.0.13\x64\iojs.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2F866A [C:\...\angular\node_modules\sqlite3\build\node_sqlite3.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\...\angular\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\...\\angular\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=3.0.13" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=node_sqlite3" "--module_path=C:\\...\\angular\\node_modules\\sqlite3\\lib\\binding\\electron-v3.0-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v4.0.6/{toolset}/" "--package_name=electron-v3.0-win32-x64.tar.gz"
gyp ERR! cwd C:\...\angular\node_modules\sqlite3
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

With all these warnings and that one error I am totaly lost, so any help is very much appreciated.有了所有这些警告和一个错误,我完全迷失了,所以非常感谢任何帮助。

With electron-forge, there seems to be some problem running the app with sqlite3.使用电子伪造,使用 sqlite3 运行应用程序似乎存在一些问题。 Try making sqlite3 (I am using better-sqlite3) as an external dependency in your webpack configuration.尝试将 sqlite3(我使用的是 Better-sqlite3)作为 webpack 配置中的外部依赖项。

  externals: {
    'better-sqlite3': 'commonjs better-sqlite3',
  },

This works in the dev environment but it fails in the build (after running make).这在开发环境中有效,但在构建中失败(在运行 make 之后)。
The better-sqlite3 won't be found in the build, since we have made it external dependency. better-sqlite3不会在构建中找到,因为我们已经使它成为外部依赖。

Didn't get a proper solution yet.还没有得到合适的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Electron-Forge 中成功高效地安装 SQLite3? - How to Successfully and Efficiently Install SQLite3 in Electron-Forge? 使用VSCode调试电子锻造应用程序 - Debug electron-forge app with VSCode Electron-forge npm run make“错误:找不到您的应用程序的主要入口点。” - Electron-forge npm run make "Error: The main entry point to your app was not found." 打包应用程序后电子和sqlite3问题 - Electron and sqlite3 issue after packaging app 使用电子锻造应用程序中的快递服务 static 文件 - Serve static files with express from within electron-forge app 无法在电子锻造应用程序中使用本机节点模块 - cannot use native node module in electron-forge app 使用带有电子编译和电子松鼠启动的电子锻造初始化电子应用程序时出错 - Error when initialising electron App using electron-forge with electron-compile and electron-squirrel-startup 在电子锻造 + webpack 应用程序中使用电子构建器构建的应用程序显示空白屏幕 - App built using electron-builder in electron-forge + webpack application shows blank screen 安装sqlite3模块后无法重建我的电子应用程序 - Cant rebuild My electron App After Installing sqlite3 module “未捕获的 ReferenceError:require is not defined” 在 index.html 的电子锻造应用程序与反应模板 - “Uncaught ReferenceError: require is not defined” in index.html of electron-forge app with react template
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM