electron-forge make results in Error: Could not find any make targets configured for the "win32" platform

Viewed 1320
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:{}
2 Answers

It worked for me by removing and reinstalling the dependencies

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

In my case, the problem was due to missing the makers configuration in my forge.config.js since I opted for using that instead of another property in the package.json.

When you run the electron-forge import command, it ends up configuring a bunch of makers:

  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",
    },
  ],
Related