#electron forge error build

4 messages · Page 1 of 1 (latest)

plain topaz
#

Hello, I've just added Electron Forge to my project, but when I run the commands npm run package, npm run make, or npm run start, nothing seems to work. It's asking me to install Electron Forge packages. Here's my package.json file:

"dependencies": {
  "axios": "^1.5.0"
},
"devDependencies": {
  "@electron-forge/cli": "^6.4.1",
  "@electron-forge/maker-deb": "^6.4.1",
  "@electron-forge/maker-rpm": "^6.4.1",
  "@electron-forge/maker-squirrel": "^6.4.1",
  "@electron-forge/maker-zip": "^6.4.1",
  "@electron-forge/plugin-auto-unpack-natives": "^6.4.1",
  "electron": "^26.1.0"
}

I'm not sure why I'm encountering this issue. Can you provide some guidance on how to resolve it? Thank you!

#

my error:

> [email protected] make
> electron-forge make

✔ Checking your system
✔ Loading configuration   
✖ Resolving make targets   
   
  › Could not find module with name '@electron-forge/maker-zip'. If this is a package from NPM, make sure it's listed in the devDependencies of your package.json. If this is a local module, make sure you have the correct pa…  
◼ Running package command
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook

An unhandled rejection has occurred inside Forge:
Error: Could not find module with name '@electron-forge/maker-zip'. If this is a package from NPM, make sure it's listed in the devDependencies of your package.json. If this is a local module, make sure you have the correct path to its entry point. Try using the DEBUG="electron-forge:require-search" environment variable for more information.
at Task.task (Roaming\npm\node_modules\@electron-forge\cli\node_modules\@electron-forge\core\dist\api\make.js:102:35)
    at Task.run (Roaming\npm\node_modules\@electron-forge\cli\node_modules\listr2\dist\index.cjs:978:35)
plush temple
# plain topaz my error: ``` > [email protected] make > electron-forge make ✔ Checking your s...

In package.json file has 2 dependency type. One of them is devDependencies other is dependencies.when ur app is in dev enviroment then electron uses devDependencies but when u wanna build executable then electron looks dependencies.add packages to devDependencies which is only needed for development enviroment.if your project is done and you do not wanna mess around just add all depedencies to dependencies section in package.json

#

If you do not have package in node modules and wanna download from npm then use --save param not --save-dev

npm i package_name --save