Open erichs opened 4 years ago
2020 here we go, facing the same thing :)
I' m trying to build for Win x64 and getting the same error
• electron-builder version=20.44.4
• loaded configuration file=package.json ("build" field)
• writing effective config file=builder/builder-effective-config.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=2.0.18 appOutDir=builder/win-unpacked
⨯ error: fork/exec /Users/anibal/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine: bad CPU type in executable
Upgraded from Mojave to Catalina today, and also got this. There has got to be some quick fix?
Same thing here. Upgraded to Catalina and getting the same error
Did you figure it out, guys?
@dalibor-123 From what I found. Catalina dropped all support for 32 bits libs. Wine has a 64 bits version but even this one depends on 32 bit libs, so we won't be able to run it on Catalina. Didn't found any workround.
@anibaldeboni Hello, thank you very much for your reply. I already found some issue (I don't have it at hand right now) about the same problem and it led to new electron-builder version so upgrading electron-builder to latest version fixed the problem for me 😄.
⨯ error: fork/exec /Users/xxx/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine: bad CPU type in executable
same error here, Catalina is the worst version of macos, tons of bugs
Did you guys upgraded electron-builder?
Started facing same issue, any clue please?
error: fork/exec /Users/user1/Library/Caches/electron-builder/wine/wine-2.0.3-mac-10.13/bin/wine: bad CPU type in executable
This happened to me today, while trying to maintain an electron app, everything goes well except when I try to generate the windows package, BOOM !
I guess Catalina stopped supporting 32, and electron-builder is using it and gives no other options to switch to wine64.
POF :
wine
commandThis will give you the exact error as Electron builder bad CPU type in executable
.
The command wine64 works like a charm tho
Still digging to find a solution for this issue and will post it here, if anyone has figured it out, it will be a great thing to see a solution.
I solved this after a long struggle of couple of days on my MacOs Catalina.
This suggestion guided me to the way.
Steps for me were little different...
Installed electron-builder as local devDependency inside my project folder.
Installed rcedit inside my project folder as local module. (Earlier it was using global one from Library). The difference in the two was rcedit64.exe. The global which was installed automatically by electron builder didn't had rcedit64.exe, but when I installed as local module it was there.
Second important step was inside
around line number 40 I changed rcedit = process.arch === 'x64' ? 'wine64' : 'wine' to rcedit = process.arch === 'x64' ? 'wine64' : 'wine64'
Now it works perfectly. However one issue introduced after that, which is.. earlier I was preparing mac and windows build in one go by having both configs in my build.json, but now both together doesn't work and gives same error, however if I remove one of them then other works. So I prepare build one by one for windows and mac.
Hope this helps. Thanks
@satinder1208 I confirm your solution works like a charm! grateful and thankful for the approach you've come with.
@satinder1208 I confirm your solution works like a charm! grateful and thankful for the approach you've come with.
Glad to hear that. Thanks
I solved this after a long struggle of couple of days on my MacOs Catalina.
This suggestion guided me to the way.
Steps for me were little different...
- Installed electron-builder as local devDependency inside my project folder.
- Installed rcedit inside my project folder as local module. (Earlier it was using global one from Library). The difference in the two was rcedit64.exe. The global which was installed automatically by electron builder didn't had rcedit64.exe, but when I installed as local module it was there.
- Second important step was inside /node_modules/rcedit/lib/rcedit.js
around line number 40 I changed rcedit = process.arch === 'x64' ? 'wine64' : 'wine' to rcedit = process.arch === 'x64' ? 'wine64' : 'wine64'
Now it works perfectly. However one issue introduced after that, which is.. earlier I was preparing mac and windows build in one go by having both configs in my build.json, but now both together doesn't work and gives same error, however if I remove one of them then other works. So I prepare build one by one for windows and mac.
Hope this helps. Thanks
My rcedit.js looks different. On line 9, my file has the following
const rceditExe = process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit.exe'
const rcedit = path.resolve(__dirname, '..', 'bin', rceditExe)
Any idea what I should change this too? I've tried the following variations
const rceditExe = process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit-x64.exe'
const rceditExe = process.arch === 'x64' ? 'rcedit.exe' : 'rcedit.exe'
const rceditExe = process.arch === 'x64' ? 'wine64' : 'wine64'
All of these variants are still throwing the same error upon packaging.
bad CPU type in executable
I solved this after a long struggle of couple of days on my MacOs Catalina. This suggestion guided me to the way. Steps for me were little different...
- Installed electron-builder as local devDependency inside my project folder.
- Installed rcedit inside my project folder as local module. (Earlier it was using global one from Library). The difference in the two was rcedit64.exe. The global which was installed automatically by electron builder didn't had rcedit64.exe, but when I installed as local module it was there.
- Second important step was inside /node_modules/rcedit/lib/rcedit.js
around line number 40 I changed rcedit = process.arch === 'x64' ? 'wine64' : 'wine' to rcedit = process.arch === 'x64' ? 'wine64' : 'wine64' Now it works perfectly. However one issue introduced after that, which is.. earlier I was preparing mac and windows build in one go by having both configs in my build.json, but now both together doesn't work and gives same error, however if I remove one of them then other works. So I prepare build one by one for windows and mac. Hope this helps. Thanks
My rcedit.js looks different. On line 9, my file has the following
const rceditExe = process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit.exe'
const rcedit = path.resolve(__dirname, '..', 'bin', rceditExe)
Any idea what I should change this too? I've tried the following variations
const rceditExe = process.arch === 'x64' ? 'rcedit-x64.exe' : 'rcedit-x64.exe'
const rceditExe = process.arch === 'x64' ? 'rcedit.exe' : 'rcedit.exe'
const rceditExe = process.arch === 'x64' ? 'wine64' : 'wine64'
All of these variants are still throwing the same error upon packaging.
bad CPU type in executable
The issue is resolved now. I just had to upgrade electron-builder to 22.2.0
I updated electron and electron-builder to their latest versions
"electron": "^13.1.6", "electron-builder": "^22.11.7"
and used v14 of node
For those still having this issue and not being able to upgrade electron-builder and it's dependencies, one workaround would be using the docker build approach: https://www.electron.build/multi-platform-build.html#docker
I updated to the latest electron-builder but I was still running into this issue. The fix for me was to install Rosetta 2 on my M1 Mac.
It appears that MacOS Catalina no longer supports any 32-bit compatible binaries. Attempting to build for the
win32
platform on MacOS Catalina produces an error of the form:I'm not sure if this issue belongs here or in the Electron-Builder project, but felt it was worth reporting.