乐趣区

关于electron:mac用electronforge打包exe包

首先 package.json,scripts 外面要新增

–arch x64 代表 64 位,
–platform win32 代表 windows 包

“package2”: “electron-forge package –arch x64 –platform win32”,
“make2”: “electron-forge make –arch x64 –platform win32”,

    "scripts": {
      "start": "electron-forge start",
      "package": "electron-forge package",
      "package2": "electron-forge package --arch x64 --platform win32",
      "make": "electron-forge make",
      "make2": "electron-forge make --arch x64 --platform win32",
      "publish": "electron-forge publish",
      "lint": "echo \"No linting configured\""
    },


报错

    An unhandled rejection has occurred inside Forge:
Error: Wrapper command 'wine64' not found on the system. Run `brew install --cask wine-stable` to install 64-bit wine on macOS via Homebrew.

Wine is required to use the appCopyright, appVersion, buildVersion, icon, and 
win32metadata parameters for Windows targets.

See https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms for details.

Electron Forge was terminated. Location:

起因是 mac 没有 windows 环境,须要运行 brew install –cask wine-stable 装置一下

后果 brew 版本太低,外网不稳固,又升不下来

起初又找了个国内镜像
间接运行,依照中文提醒操作,能够间接降级 brew

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed

最初打包胜利!

退出移动版