electron打包步骤

# npm清理缓存
npm cache clean --force

# 创建文件夹
mkdir xxx && cd xxx

# 初始化(entry point 应为 main.js,author必填,description必填)
npm init

# 安装electron包
npm install --save-dev electron

# 安装electron包报错的话
1:npm config edit
2:将下面三行加进去
registry=https://registry.npmmirror.com
electron_mirror=https://cdn.npmmirror.com/binaries/electron/
electron_builder_binaries_mirror=https://npmmirror.com/mirrors/electron-builder-binaries/

#  在package.json配置文件中的scripts字段下增加一条start命令:
"start": "electron ."

# 运行
npm start



# 打包
# 安装electron-forge
npm install --save-dev @electron-forge/cli
npx electron-forge import

# 打包
npm run make

 

posted @ 2023-11-18 09:05  面向bug编程  阅读(121)  评论(0编辑  收藏  举报