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

4

7
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

> [email protected] 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:{}
Wenz answered 17/4, 2021 at 18:56 Comment(3)
content of package.json: { [...] "make2": "electron-forge make" }, "config": { "forge": { "make_targets": { "win32": [ "squirrel" [...] }, [...] } } }, "dependencies": { "electron-squirrel-startup": "^1.0.0" }, "devDependencies": { "@electron-forge/cli": "^6.0.0-beta.54", "electron": "^12.0.4" } }Wenz
Have you configured electron-forge properly?Verlie
Welcome to Stack Overflow. Please take the tour and read How to Ask. You can't just dump your error here. We need context, ideally as a minimal reproducible example.Baxley
B
8

It worked for me by removing and reinstalling the dependencies

npm install --save-dev @electron-forge/cli
npx electron-forge import
Blasting answered 15/7, 2021 at 22:24 Comment(0)
D
2

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",
    },
  ],
Doig answered 26/5, 2022 at 13:50 Comment(0)
D
0

Deleting the file "package-lock.json" worked for me.

Dekeles answered 12/1, 2023 at 6:57 Comment(0)
W
0

This droves me insane. Aside from having forge.config.js, adding these in my package.json worked for me.

"config": {
    "forge": {
      "makers": [
        {
          "name": "@electron-forge/maker-zip",
          "platforms": [
            "win32"
          ]
        }
      ],
      "publishers": []
    }
  }
Whitfield answered 4/4 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.