electron-builder: ENOENT: no such file or directory, rename '~\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\electron.exe' - No electron.exe found - When building for arm64 - Windows
- Electron-Builder Version: 25.1.8
- Node Version: 22.8.0
- Electron Version: 33.2.0
- Electron Type (current, beta, nightly): current
- Target: nsis, zip, 7z, portable, msi
win:
target:
- target: nsis
arch: [x64, ia32, arm64]
- target: msi
arch: [x64, ia32, arm64]
- target: portable
arch: [x64, ia32, arm64]
- target: zip
arch: [x64, ia32, arm64]
- target: 7z
arch: [x64, ia32, arm64]
executableName: wp-downloader-electron
nsis:
artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
npmRebuild: true
publish:
provider: generic
url: https://example.com/auto-updates
electronDownload:
mirror: https://npmmirror.com/mirrors/electron/
Above is a part of my electron-builder.yml. And I’m running on x64 bit Windows.
When I build articatcs
- With electron-builder --win or
- With electron-builder --win --arm64
locally (windows-x64) and github hosted runners (windows-latest), building unpack fails, no electron.exe found.
Console log:
> electron-builder --win --arm64
• electron-builder version=25.1.8 os=10.0.22631
• loaded configuration file=C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\electron-builder.yml
• writing effective config file=dist\builder-effective-config.yaml
• executing @electron/rebuild electronVersion=33.2.0 arch=arm64 buildFromSource=false appDir=./
• installing native dependencies arch=arm64
• completed installing native dependencies
• packaging platform=win32 arch=arm64 electron=33.2.0 appOutDir=dist\win-arm64\win-arm64-unpacked
⨯ ENOENT: no such file or directory, rename 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\electron.exe' -> 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\wp-downloader-electron.exe' failedTask=build stackTrace=Error: ENOENT: no such file or directory, rename 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\electron.exe' -> 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\wp-downloader-electron.exe'
And indeed there’s no electron.exe (or any other renamed executable) in dirst/win-arm64-unpacked dir.
I’ve tried using nightly/alpha versions of electron and electron-builder -> Didn’t work.
I also checked if this’s a issue with electron-binaries not providing a electron.exe, by any chance -> Electron binaries indeed have electron.exe
So, what I guess it that electron-builder either removes electron.exe or can’t copy. As far I know there’s nothing to do with electron.exe except for changing the icon and renaming.
[!NOTE] I’m new to
electron-builder, so am I doing something wrong when building for arm64 on Windows? I mean, is there any specific requirements? (I couldn’t find any in the documentation). If there’s any, please leave a link.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 19 (2 by maintainers)
The similar “ENOENT … rename” error occurred when I tried
electron-builder buildin project root. It took me some time to find out that it’s caused by the corrupted cachedelectron-v36.4.0-darwin-arm64.zip. This file is downloaded byapp-builderin the building process and might be corrupted by network change. After it’s deleted and redownloaded, the error is gone.For macOS, the cache directory is
~/Library/Caches/electron, which could be found at artifactDownloader of app-builderHere’s how I verified if it’s cached on my machine:
For now app-builder don’t do integrity-check on downloaded files, so anyone saw this error could try deleting the cache and see if it works.
Did someone find the reason for this? I too am stuck in this.
My solution is to set the electronList property in the build attribute of packagejson, with “electronList”: “./main/electronList” Then compress the corresponding version of my electron into the folder corresponding to the electronList attribute,
Yeah, I meant, that I had full paths in terminal outputs, I removed them here thinking it’d better to have a look. Updated though.
So it was like this
⨯ ENOENT: no such file or directory, rename 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\electron.exe' -> 'C:\Users\Dragon\Documents\GitHub\wp-downloader-electron\dist\win-arm64\win-arm64-unpacked\wp-downloader-electron.exe' failedTask=buildSorry if it made any confusion.