electron 电子伪造导致错误:找不到为“win32”平台配置的任何make目标

t3psigkw  于 2022-12-08  发布在  Electron
关注(0)|答案(2)|浏览(877)
electron-forge make results in Error: Could not find any make targets configured for the "win32" platform.
with command:
PS E:\VStudio\20210417> npm run make2

> 20210417@1.0.0 make2
> electron-forge make 

✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: x64
✔ Preparing native dependencies
✔ Packaging Application

An unhandled rejection has occurred inside Forge:
Error: Could not find any make targets configured for the "win32" platform.
    at _default (E:\VStudio\20210417\node_modules\@electron-forge\core\src\api\make.ts:170:11)
    at E:\VStudio\20210417\node_modules\@electron-forge\cli\src\electron-forge-make.ts:44:5   

Electron Forge was terminated. Location:{}
7kqas0il

7kqas0il1#

它通过删除并重新安装依赖项来帮助我

npm install --save-dev @electron-forge/cli
npx electron-forge import
csga3l58

csga3l582#

在我的例子中,问题是由于在我的forge.config.js中缺少makers配置,因为我选择使用该配置而不是package.json中的另一个属性。
当您运行electron-forge import命令时,它最终会配置一组maker:

makers: [
    {
      name: "@electron-forge/maker-zip",
    },
    {
      name: "@electron-forge/maker-squirrel",
      config: {
        name: "my-app-here",
      },
    },
    {
      name: "@electron-forge/maker-deb",
    },
    {
      name: "@electron-forge/maker-rpm",
    },
  ],

相关问题