gpt4 book ai didi

javascript - Electron Js - 主进程发生javascript错误

转载 作者:行者123 更新时间:2023-12-04 11:44:32 41 4
gpt4 key购买 nike

我创建了一个运行良好的 Electron 项目,但是当我尝试使用 Electron 打包器打包 Electron 应用程序然后运行它时。我面临一个异常(exception)
未捕获的异常:
错误:找不到模块
需要堆栈
'E:\app-folder..release-builds\app-win32-ia32\resources\app....\node_sqlite3.node'
click here to see Error
'这是我的 package.json'

{
"name": "app",
"version": "1.0.0",
"main": "main.js",
"devDependencies": {
"electron": "^8.2.0",
"electron-builder": "^22.8.0",
"electron-rebuild": "^1.10.1"
},
"scripts": {
"start": "electron .",
"rebuild": "electron-rebuild -f -w sqlite3",
"package-win": "electron-packager . App--overwrite --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"App\"",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"axios": "^0.19.2",
"concat-stream": "^2.0.0",
"datatables.net": "^1.10.20",
"datatables.net-dt": "^1.10.20",
"ejs": "^3.1.5",
"electron-packager": "^15.0.0",
"express-validator": "^6.6.1",
"form-data": "^3.0.0",
"jquery": "^3.5.0",
"nodemailer": "^6.4.11",
"sqlite3": "^5.0.0"
}
}

最佳答案

npm install --save-dev @electron-forge/cli
npm run package
尝试运行这些命令,您将得到 out文件夹和应用程序存在于 out文件夹

关于javascript - Electron Js - 主进程发生javascript错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63845051/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com