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.

--asar-unpack not working due to invalid glob syntax

See original GitHub issue

I am trying to bundle an electron app that uses the node-notifier module. In order to get the node-notifier module to work, it has to be unpacked when doing asar. I have tried to use both asar-unpack and asar-unpack-dir to get it to work, but neither seems to be working.

The call I am trying to use is ./node_modules/electron-packager/cli.js . MyApp --platform=darwin --arch=x64 --version=0.36.0 --asar=true --asar-unpack="./node_modules/node-notifier/vendor/**" --overwrite --out dist/and it is working 100% as expected except for the unpacking.

However, running asar pack . app.asar --unpack "./node_modules/node-notifier/vendor/**" does work. I can even then replace the app.asar that electron-packager creates in the Resources folder (along with adding the app.asar.unpacked folder) and everything works as expected.

This is occurring in version 5.2.0 of electron-packager.

There are no errors that I can see that are shown when I try to use the unpack parameter. Everything seems to work fine, except that there is no app.asar.unpacked directory created within the electron app.

Steps to reproduce:

  1. Run ./node_modules/electron-packager/cli.js . MyApp --platform=darwin --arch=x64 --version=0.36.0 --asar=true --asar-unpack="./node_modules/node-notifier/vendor/**" --overwrite --out dist/ on an electron app
  2. Navigate to ./dist/MyApp-darwin-x64/MyApp.app/Contents/Resources
  3. Notice that app.asar has been created, but app.asar.unpacked has not been.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
maleptcommented, Jan 24, 2019

It seems like it’s because asar uses absolute paths. This works:

electron-packager . BTCPlus --asar.unpack="**/node_modules/node-notifier/vendor/**"
1reaction
schneidmastercommented, May 4, 2016

@stormageddon Just solved exactly this issue – all you need to do is remove the “./” in the node-notifier path, i.e.

--asar-unpack="node_modules/node-notifier/vendor/**"

not

--asar-unpack="./node_modules/node-notifier/vendor/**"

Read more comments on GitHub >

github_iconTop Results From Across the Web

builder-util-runtime | Yarn - Package Manager
Incorrect error message (bc0952e), closes #1236; deployment: NSIS Web ... Bug Fixes. Unable to build package because of asarUnpack (e3cfa8e), closes #937 ...
Read more >
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 >
Common Configuration - electron-builder
asarUnpack Array<String> | String | “undefined” - A glob patterns relative to the app directory, which specifies which files to unpack when creating...
Read more >
WASM loader for Node - kandi - Open Weaver
Implement node-loader with how-to, Q&A, fixes, code snippets. kandi ratings - Low support, No Bugs, No Vulnerabilities. Permissive License, Build available.
Read more >
Gulp error "Invalid glob argument" while running angular ...
Hello, We are getting the following Gulp error after giving the "npm start" command while running the angular project. version : 8.6 ....
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