我想建立这个电子应用程序,但它给我一个错误,当我键入npm run make
错误:It looks like you are missing some dependencies you need to get Electron running. Make sure you have git installed and Node.js version >= 14.17.5
我从https://git-scm.com/download/win安装了git,但仍然有同样的问题,这是package.JSON文件:
"name": "OverStat",
"version": "1.0.0",
"main": "main.js",
"devDependencies": {
"@electron-forge/cli": "^6.0.4",
"electron": "^22.0.0",
"electron-reloader": "^1.2.3"
},
"scripts": {
"start": "electron .",
"make": "electron-forge make"
},
"dependencies": {
"electron-builder": "^23.6.0"
}
}
编辑
我重新启动了VS代码,现在发生了这种情况
✔ Checking your system
✔ Loading configuration
✖ Resolving make targets
› Could not find any make targets configured for the "win32" platform.
◼ Running package command
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook
An unhandled rejection has occurred inside Forge:
Error: Could not find any make targets configured for the "win32" platform.
at Task.task (D:\projects\electron learning\node_modules\@electron-forge\core\dist\api\make.js:122:27)
at Task.run (D:\projects\electron learning\node_modules\listr2\dist\index.cjs:978:35)
编辑2
这是forge.config.js文件:
module.exports = {
packagerConfig: {},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
};
1条答案
按热度按时间cgfeq70w1#
更新:我在
"makers"
中的package.json中添加了这个,它刚刚工作: