electron打包报错:Error:Application entry file“xx.asar“ does not exist. Seems like a wrong configuration.

问题

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": "版本更新的具体内容"
  }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值