Electron-packager: `--asar` should be enabled by default

Created on 18 May 2015  路  13Comments  路  Source: electron/electron-packager

I don't see why you wouldn't want those and I think most do. We could instead have --no-asar and --no-prune flags. I much prefer us to have sane defaults, which means less config mess for users.

enhancement help wanted needs work

All 13 comments

I support both of these as defaults

i had seen a lot of open issues involving asar on the electron repo since it's relatively new. but if we think its bug-free now then i'm good with it

I don't think it's bug free, but it's pretty stable now, and Atom is using it so any issue will be fixed fast.

aside: as someone who just had to leave their computer on overnight copying over a large ~/dev directory full of hundreds of thousands of files from node_modules directory trees on a faulty SSD, I kinda wish a certain software platform would move to archive-based dependencies, too :)

Only bad part of this is you'll have to re-install when you prune. Here's what I'm doing:

# make a regex of node_modules to ignore
ignores=`npm ls --dev --parseable`
# get the package name
ignores=$(echo $ignores | sed -e 's@.*/@@')
# skip the first line
ignores=`echo $ignores | awk '{if(NR > 1) print $0}'`
# join with a pipe
ignores=${ignores//$'\n'/'|'}

# build mac distibutable app
./node_modules/.bin/electron-packager . "Dev Tool" \
  --platform=darwin --arch=x64 --version=0.35.6 \
  --ignore=\"$ignores\" \
  --app-bundle-id "com.dev-too.appl" --app-version 0.1.0 \
  --out ./built

zsh: command too long :(

if you pass the --prune flag to electron-packager it prunes for you in its tmpdir copy, which doesnt affect your source folder

well then there we go!

I have no problem with making prune default to true.

The main problem I have with making asar default to true is that as soon as that gets released, there is going to be an influx of issues filed on electron-packager with "module not found" errors when people use native extensions. Or really, any exception listed in the Electron docs.

I mentioned this issue in Electron's Slack channel a few weeks ago. Paul Betts mentioned that the way to handle my concerns about making asar true by default is to make sure that all shared libraries (.dll, .so, .dylib, .node) are backlisted from being packed by default. If someone implements that plus writes the appropriate amount of documentation (we may have to start a docs/faq.md), then I think I will be :+1: with moving forward.

@malept @sindresorhus @maxogden sorry to bother you all...

Was anything ever done re this one?

I have a proper ball ache of an issue where my packaged electron app fails to find react in any of my installed dependencies (react-player, react-countup, prismic-reactjs etc).

could anyone offer any advice?

Was anything ever done re this one?

This issue is flagged "help wanted" and is still open.

could anyone offer any advice?

If you need assistance, please use one of the community forums.

asar packaging produces broken icon in about window on linux platform: https://github.com/electron/electron/issues/23850

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liam-Ryan picture Liam-Ryan  路  4Comments

leanderBehr picture leanderBehr  路  3Comments

Orrison picture Orrison  路  3Comments

quadrophobiac picture quadrophobiac  路  4Comments

NoahAndrews picture NoahAndrews  路  5Comments