question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Invalid package error" when using asar

See original GitHub issue
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success. Please describe your issue: 1.“electron”: “^2.0.5” 2.“electron-packager”: “^12.1.0” I want to package application include another application, it’s a packaged application.But something error .(A JavaScript error occurred in the main process). first, I use “electron-packager . --platform=darwin --electron-version=2.0.5 --overwrite --ignore=.gitignore”. It’s success to build a wrap application. second, Wrap application use nodejs to create some files like package.json and main.js, then I use the electron-packager API “packager” to build new project and something error.Please help.
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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
LudiscapeXApicommented, Aug 4, 2018

I found a solution : Turn off the asar functionality and then run it. process.noAsar = true;

1reaction
welcome[bot]commented, Aug 2, 2018

👋 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Electron - Invalid package on unzip - Stack Overflow
At the very end of the extraction, I receive a Invalid package error, and the actual app.asar file is missing, rendering the application...
Read more >
Error message app.asar with Mobirise 5.2
Hi, I installed Mobirise 5.2. When I want to publish (locally or through FTP) I receive the following error message: Error:Invalid package ......
Read more >
Options | electron-packager
An explanation can be found on the Atom issue tracker. unpack (string): A glob expression, when specified, unpacks the file with matching names...
Read more >
code signature in [app] not valid … | Apple Developer Forums
asar so that users can't just read or mess with the source code. That includes any native dependencies/libraries such as sqlite3. Apple requires...
Read more >
electron builder not allowed to load local resource - You.com
Most likely this error occurs because your path to the file is incorrect, not because of user rights or whatever. if you add...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found