electron-react-boilerplate / electron-react-boilerplate

A Foundation for Scalable Cross-Platform Apps

Home Page:https://electron-react-boilerplate.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I'm cannot create Windows binaries on a Mac m1.

yishin opened this issue · comments

Summary

I just cloned the latest version of the source and created a binary,
but Windows binaries are not being created on my Mac M1.

Windows binaries were successfully created with my code from a previous source version.
What could be the problem?

  1. clone
    git clone --depth=1 https://github.com/electron-react-boilerplate/electron-react-boilerplate test

  2. change directory
    cd test

  3. install & build
    yarn && yarn build

  4. package
    yarn package --win --x64

To answer your question, please provide more information like a stacktrace.

First thing first, this command doesn't work as expected:
yarn package --win --x64

I made a change to the docs here: electron-react-boilerplate/docs#224
To build for a specific os, copy the package.json package script and add an option for the os to electron-builder, in this case -w .

E.g. to build for windows only the command should be:
ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build -w --publish never && npm run build:dll

Granted, I'm on an M2 Mac, not M1, but they should work the same.
Changing my package command to ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build -w --x64 --publish never && npm run build:dll works as expected.

@yishin I can confirm that I can create windows binaries, both ARM and X64 on a M1 Pro