问题
Error: Application entry file "dist-electron/main/index.js" in the "/Users/huhao/
Desktop/www/cashier/build/mac/cashier.app/Contents/Resources/app.asar"
does not exist. Seems like a wrong configuration.
electron打包编译报错,根据翻译:
错误:“/Users/huhao/Desktop/www/cacher/build/mac/banker.app/Contents/Resources/app.asar”中的应用程序条目文件“dist-electron/main/index.js”不存在。看起来是错误的配置。
这个是因为在package.json
文件配置里“build” => "files"没有配置对应的需要打包的文件。
"files": [
"build"
],
package.json配置
"build": {
"appId": "com.cashier.desktop",
"productName": "cashier",
"asar": true,
"copyright": "Copyright © 2022 electron",
"files": [
"build",
"dist-electron/preload",
"dist-electron/main",
"package.json"
],
"directories": {
"output": "build"
},
"extends": null,
"mac": {
"artifactName": "${productName}_${version}.${ext}",
"target": [
"dmg"
]
},
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
}
],
"artifactName": "${productName}_${version}.${ext}"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
},
"releaseInfo": {
"releaseNotes": "版本更新的具体内容"
}
}