when I try to build the electron app i get this error
⨯ zip: not a valid zip file
Got it too. But it immediately went away in the next run.
I tried to run it multiple times but still get the same error!
Same here.
+1
$ rm ~/Library/Caches/electron
I think this should be an aborted download of the zip file. Does anyone knows where it stands so one can remove it to be downloaded again?
EDIT: This was happening while compiling for windows. After switching between squirrel and nsis it solved the problem.
For Mac, you may delete the cache electron zip file at ~/Library/Caches/electron
Getting the same error in Windows while trying to just build an exe.
electron-builder: v20.28.2
electron: v2.0.8
My simple build object in package.json is as following:
"build": {
"productName": "product-name",
"appId": "com.xyz.abc",
"directories": {
"output": "build"
},
"files": [
"dist/electron/**/*"
],
"win": {
"icon": "build/icons/icon.ico"
},
"publish": null
}
Is there anything wrong?
The problem is probably a corrupted cached zip file. Try clearing the cache (wherever it is on Windows).
same error. cleared the cached zip file but it doesn't help. what is the reason on earth?
Maybe another cache? That's what happened to me.
NOTE: On linux, these zip files are placed in $HOME/.cache/electron
directory.
And by the way, this shall be a bug of electron-builder. If hash missmatch or zip file not fully downloaded, why not remove it and re-download zip file?
Got same issue. Remove cache (~/Library/Caches/electron on mac) fixed it. It forces reloading
I Found Path on windows : C:\Users\Your Username\AppData\Local\electron\Cache
Delete Zip file from this folder :)
I just had the same issue. I am running Linux and deleting $HOME/.cache/electron
didn't fix it because this apparently is the wrong path. Check the paths here: https://github.com/electron-userland/electron-download#cache-location
On Linux you can delete the cache folder
rm -rf ~/.cache/electron
It worked for me when I had the same problem
@samuelcarreira Please provide full stack trace of error.
Most helpful comment
For Mac, you may delete the cache electron zip file at ~/Library/Caches/electron