我按照Electron Forge page安装了Electron的模板.
npx create-electron-app my-new-app --template=typescript-webpack
在那之后,我会跑
npm run start
Inside my-new-app
文件夹和以下错误消息在命令窗口中弹出
$ npm run start
> my-new-app@1.0.0 start
> electron-forge start
✔ Checking your system
✔ Locating Application
An unh和led rejection has occurred inside Forge:
Error: Expected plugin to either be a plugin instance or a { name, config } object but found @electron-forge/plugin-webpack,[object Object]
Electron Forge was terminated. Location:
{}
我在谷歌上搜索了一下,但没有人犯同样的错误. 我可以使用上述模板,而不会在一周前出现错误消息.所以,我复制了一周前制作的项目并运行.这是一次成功.但是,我运行以下命令
npm audit
有22个漏洞(3个中等,19个高). 错误包括
got <11.8.5
Severity: moderate
和
minimatch <3.0.5
Severity: high
It could not fix by npm audit fix
和 npm audit fix --force
. So, I fixed this error by rewriting package.json
和 package-lock.json
. Then I deleate node_modules
folder 和 run npm install
.
These vulnerabilities are gone, but above my problem were again after I run npm run start
.
我认为@electron-forge/plugin-webpack
有问题.
然而,我不知道如何修复它.
先谢谢你.