使用 sqlite 数据库连接运行电子应用程序 main.ts 时出错

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

“pg-hstore”由“pg-hstore?commonjs-external”导入,但无法解析 - 将其视为外部依赖项。 ✓ 改造了 891 个模块。 dist-电子/main.js 2,899.97 kB │ gzip: 456.42 kB 耗时 5124 毫秒。 应用程序在加载期间抛出错误 错误:找不到模块“pg-hstore” 需要堆栈:

  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/node_modules/electron/dist/resources/default_app.asar/main.js
  • 在节点:内部/模块/cjs/loader:1084:15 在 Function._resolveFilename (节点:电子/js2c/browser_init:2:117576) 在节点:内部/模块/cjs/loader:929:27 在 Function._load (节点:电子/js2c/asar_bundle:2:13327) 在 Module.require (节点:内部/模块/cjs/loader:1150:19) 在需要时(节点:内部/模块/cjs/helpers:110:18) 在对象。 (/home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js:10:22) 在Module._compile(节点:内部/模块/cjs/loader:1271:14) 在 Object..js (节点:内部/模块/cjs/loader:1326:10) 在Module.load(节点:内部/模块/cjs/loader:1126:32) 主进程中发生 JavaScript 错误 未捕获的异常: 错误:找不到模块“pg-hstore” 需要堆栈:
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/node_modules/electron/dist/resources/default_app.asar/main.js
  • 在节点:内部/模块/cjs/loader:1084:15 在 Function._resolveFilename (节点:电子/js2c/browser_init:2:117576) 在节点:内部/模块/cjs/loader:929:27 在 Function._load (节点:电子/js2c/asar_bundle:2:13327) 在 Module.require (节点:内部/模块/cjs/loader:1150:19) 在需要时(节点:内部/模块/cjs/helpers:110:18) 在对象。 (/home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js:10:22) 在Module._compile(节点:内部/模块/cjs/loader:1271:14) 在 Object..js (节点:内部/模块/cjs/loader:1326:10) 在Module.load(节点:内部/模块/cjs/loader:1126:32)

我正在尝试通过在 main.js 函数 createWindow() 中调用 ipc 事件来创建具有后续 umzug 迁移的 sqlite 数据库。然后出现这个错误。

reactjs sqlite electron sequelize.js ipc
1个回答
0
投票

看起来您需要安装

pg-hstore
模块。

npm install --save pg-hstore
© www.soinside.com 2019 - 2024. All rights reserved.