electron打包

mkdir my-electron-app && cd my-electron-app
npm init ;生成package.json文件
package.json文件的内容如下

{
  "name": "my-electron-app",
  "version": "1.0.0",
  "description": "Hello World!",
  "main": "main.js",
  "author": "Jane Doe",
  "license": "MIT"
}

author和description项不能为空,否者npm run make会报错
在根目录创建好以下3个文件,参考:
https://github.com/electron/electron/tree/v25.5.0/docs/fiddles/quick-start

npm install --save-dev electron
npm install --save-dev @electron-forge/cli
npx electron-forge import

最后执行
npm run make
生成应用程序包

发表回复