forge: Built-in templates do not start
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
6.0.0-beta.70
Electron version
v21.2.0
Operating system
Windows 10 Version 21H1 Build 19043.2130
Last known working Electron Forge version
6.0.0-beta.65
Expected behavior
After running the following commands
yarn create electron-app test --template=webpack
cd test
npm run start
then the empty application should start.
Actual behavior
test>npm run start
test@1.0.0 start electron-forge start
√ Checking your system √ Locating Application
An unhandled rejection has occurred inside Forge: Error: package.json for app does not have any devDependencies
Electron Forge was terminated. Location: {}
Steps to reproduce
See above
Additional information
Running node_modules\.bin\electron-forge --version
returns this:
√ Checking your system
6.0.0-beta.70
However according to packages.json it’s beta.69 that’s installed.
{
"name": "test",
"productName": "test",
"version": "1.0.0",
"description": "My Electron application description",
"main": ".webpack/main",
"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": "cwellsx",
"email": "cwellsx@example.com"
},
"license": "MIT",
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.69",
"@electron-forge/maker-deb": "^6.0.0-beta.69",
"@electron-forge/maker-rpm": "^6.0.0-beta.69",
"@electron-forge/maker-squirrel": "^6.0.0-beta.69",
"@electron-forge/maker-zip": "^6.0.0-beta.69",
"@electron-forge/plugin-webpack": "6.0.0-beta.69",
"@vercel/webpack-asset-relocator-loader": "1.7.3",
"css-loader": "^6.0.0",
"electron": "21.2.0",
"node-loader": "^2.0.0",
"style-loader": "^3.0.0"
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
}
}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (9 by maintainers)
@VerteDinde I found the issue. When
create-electron-app
is installed, it installs forge as a dependency. Whencreate-electron-app
is run, it calls@electron-forge\cli\dist\electron-forge-init.js
, which ultimately copies the package.json fromcreate-electron-app
’s package.json and runsnpm install
/yarn install
.In other words: the forge version you get depends on when
create-electron-app
was first run on your system. The same applies for any other dependencies, like@vercel/webpack-asset-relocator-loader
as you can see in the comments above. Since@electron-forge/plugin-webpack
is pinned in the package.json, that specific (and probably outdated) version is always installed.When I run
create-electron-app
on npm instead of Yarn, I getbeta-59
. You’re getting the latest version because the computers you’re testing on never rancreate-electron-app
before.No global
electron-forge
here:Oddly, when I do a fresh install with
yarn create electron-app test2 --template=webpack
on Windows, it pinsplugin-webpack
to6.0.0-beta.64
, not6.0.0-beta.69
as OP. So the version I’m getting is also wrong, but different:I’m getting a different error because of the old plugin syntax used in
beta-64
: