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:{}
electron-forge make results in Error: Could not find any make targets configured for the "win32" platform
Asked Answered
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
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",
},
],
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": []
}
}
© 2022 - 2024 — McMap. All rights reserved.