I have created and electron application and trying to use electron forge for building purpose. Please find below command which i have run it for creating the electron application:
#npm i -g create-react-app
#npm i -g @electron-forge/cli
#npx create-electron-app my-ele-app
The above last command created a project my-ele-app. and now i am able to start the application as well. #npm start.
content of package.json file is:
{
"name": "my-ele-app",
"productName": "my-ele-app",
"version": "1.0.0",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "rohit",
"email": "[email protected]"
},
"license": "MIT",
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "my_ele_app"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.55",
"@electron-forge/maker-deb": "^6.0.0-beta.55",
"@electron-forge/maker-rpm": "^6.0.0-beta.55",
"@electron-forge/maker-squirrel": "^6.0.0-beta.55",
"@electron-forge/maker-zip": "^6.0.0-beta.55",
"electron": "12.0.9"
}
}
Now when i am running below command, it is throwing error:
#npm run make
Error is:
> [email protected] make
> electron-forge make
√ Checking your system
√ Resolving Forge Config
An unhandled rejection has occurred inside Forge:
Error: Could not find module with name: @electron-forge/maker-squirrel. Make sure it's listed in the devDependencies of your package.json
at _default (C:\Users\212807091\Desktop\Rohit\Office Note\RBAC\Electron_project\npx_electrong\my-ele-app\node_modules\@electron-forge\core\src\api\make.ts:125:15)
at C:\Users\212807091\Desktop\Rohit\Office Note\RBAC\Electron_project\npx_electrong\my-ele-app\node_modules\@electron-forge\cli\src\electron-forge-make.ts:44:5
Electron Forge was terminated. Location:
{}
NOTE: i can see there is module available in node_modules folder: my-ele-app\node_modules@electron-forge\maker-squirrel
If anyone here has any idea how to fix this issue. please provide the answer. Thanks!