项目场景:
在使用electron打包的时候npm run make
出现如下问题
问题描述:
例如:错误代码:An unhandled error has occurred inside Forge:
An error occured while making for target: squirrel
Failed with exit code: 1
Output:
���ڳ��Դӡ�my_electron_app.nuspecï¿½ï¿½ï¿½ï¿½ï¿½É³ï¿½ï¿½ï¿½ï¿½ï¿½ï¿ ½
Description is required.
Error: Failed with exit code: 1
Output:
���ڳ��Դӡ�my_electron_app.nuspecï¿½ï¿½ï¿½ï¿½ï¿½É³ï¿½ï¿½ï¿½ï¿½ï¿½ï¿ ½
Description is required.
at ChildProcess.<anonymous> (C:\Users\Admin\Desktop\Electrion\my-electron-ap p\node_modules\electron-winstaller\src\spawn-promise.ts:52:16)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:483:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
原因分析:
在package.json
文件里面的description
字段为空
description
字段作用是:一个描述,方便别人了解你的模块作用,搜索的时候也有用。
解决方案:
为description字段添加内容,例如:"description": "My Electron app"