Unhandled rejection Error: Invalid package /private/var/folders/2w/13b_340j6qj0xtz5jgcyzj7w0000gn/T/electron-packager/darwin-x64-template/Electron.app/Contents/Resources/default_app.asar
at invalidArchiveError (ELECTRON_ASAR.js:153:19)
at Object.module.(anonymous function) [as open] (ELECTRON_ASAR.js:209:16)
at WriteStream.open (fs.js:2158:6)
at new WriteStream (fs.js:2144:10)
at Object.fs.createWriteStream (fs.js:2106:10)
馃憢 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 馃悶 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
In order to debug your problem further, we need a minimal testcase to reproduce your problem. Using the electron-quick-start repository as a base, could you please create a minimal Electron app that illustrates the issue you described, and post a link to it here?
I have the same problem with electron-packager on Win 10:
Same resut with a new app create with the electron-quick-start as a base
Packaging app for platform win32 ia32 using electron v2.0.6
Unhandled rejection Error: Invalid package C:\Users\suppo\AppData\Local\Temp\electron-packager\win32-ia32-template\resources\default_app.asar
at invalidArchiveError (ELECTRON_ASAR.js:153:19)
at Object.module.(anonymous function) [as open] (ELECTRON_ASAR.js:209:16)
at WriteStream.open (fs.js:2158:6)
at new WriteStream (fs.js:2144:10)
at Object.fs.createWriteStream (fs.js:2106:10)
at writeStream (C:\Electron\open-grid\node_modules\extract-zip\index.js:175:36)
at C:\Electron\open-grid\node_modules\extract-zip\index.js:172:18
at C:\Electron\open-grid\node_modules\yauzl\index.js:439:7
at C:\Electron\open-grid\node_modules\yauzl\index.js:473:5
at C:\Electron\open-grid\node_modules\fd-slicer\index.js:32:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)
But If i extract manualy the package
C:\Users\suppo\AppData\Local\electron\Cache\electron-v2.0.0-win32-ia32.zip
into
C:\Users\suppo\AppData\Local\Temp\electron-packager
A new error is show :
`Unhandled rejection Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\suppo\AppData\Local\Temp\electron-packager\win32-ia32-template\resources'
electron-quick-start.zip
`
@LudiscapeXApi I cannot reproduce this on Linux with your zip file. The packaged app runs normally.
Why are you specifying prune: false?
I cannot reproduce this on Ubuntu 18 too. Only on Win 10.
prune false/true same result :
Packaging app for platform win32 ia32 using electron v2.0.6
Unhandled rejection Error: Invalid package C:\Users\suppo\AppData\Local\Temp\electron-packager\win32-ia32-template\resources\default_app.asar
at invalidArchiveError (ELECTRON_ASAR.js:153:19)
at Object.module.(anonymous function) [as open] (ELECTRON_ASAR.js:209:16)
and next :
Unhandled rejection Error: ENOTEMPTY: directory not empty, rmdir C:\Users\suppo\AppData\Local\Temp\electron-packager\win32-ia32-template\resources
I found a solution :
Turn off the asar functionality and then run it.
process.noAsar = true;
@LudiscapeXApi @malept thank you guys.I set process.noAsar = true.The packaged app runs normally.
Most helpful comment
I found a solution :
Turn off the asar functionality and then run it.
process.noAsar = true;