[TOC] ## 安装 `npm install electron-packager --save-dev ` ## 执行 ``` electron-packager <location of project> <name of project> <platform> <architecture> <electron version> <optional options> ``` * location of project:项目所在路径  * name of project:打包的项目名字  * platform:确定了你要构建哪个平台的应用(Windows、Mac 还是 Linux)  * architecture:决定了使用 x86 还是 x64 还是两个架构都用  * electron version:electron 的版本  * optional options:可选选项 `package.json`的script 写入 ``` "scripts": { "package:win32": "electron-packager ./ ele_demo --app-version=1.0.4 --platform=win32 --arch=ia32 --overwrite --out=out --icon=./assets/img/ele.ico", "package:win64": "electron-packager ./ ele_demo --app-version=1.0.4 --platform=win32 --arch=x64 --overwrite --out=out --icon=./assets/img/ele.ico", "package:linux": "electron-packager ./ ele_demo --app-version=1.0.4 --platform=linux --arch=x64 --overwrite --out=out --icon=./assets/img/ele.ico", "package:mac": "electron-packager ./ ele_demo --app-version=1.0.4 --platform=darwin --arch=x64 --overwrite --out=out --icon=./assets/img/ele.ico", "package:all": "electron-packager ./ ele_demo --app-version=1.0.4 --all --overwrite --out=out --icon=./assets/img/ele.ico" }, ```