Skip to content

Error installing electron-forge in Linux with yarn: platform incompatible with module #136

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
soulchainer opened this issue Feb 16, 2017 · 13 comments
Labels
blocked/upstream Issues blocked by upstream bugs bug

Comments

@soulchainer
Copy link

I was just trying to install electron-forge with yarn and it won't install, saying that "linux" platform is incompatible with the module macos-alias. npm installs correctly (doesn't even throws a warning about macos-alias).

  yarn global add electron-forge --prefix ~/.npm-global

Throws (without the #, of course, just for highlight the error part):

# yarn global v0.20.3
# [1/4] Resolving packages...
# warning electron-forge > zip-folder > archiver > glob > minimatch@0.3.0:
# Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
# warning electron-forge > electron-windows-store > flatten-packages >wrench@1.5.9:
# wrench.js is deprecated! You should check out
# fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations
# you were using wrench for. Thanks for all the usage over the years.
# warning electron-forge > electron-packager > asar > mksnapshot > request > node-uuid@1.4.7:
# use uuid module instead
# warning electron-forge > nugget > progress-stream > through2 > xtend >object-keys@0.4.0:

# [2/4] Fetching packages...
# warning appdmg@0.4.5: The platform "linux" is incompatible with this module.
# info "appdmg@0.4.5" is an optional dependency and failed compatibility check. # Excluding it from installation.
error macos-alias@0.2.11: The platform "linux" is incompatible with this module.
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

Is this a problem of electron-forge with yarn (like some configuration) or a yarn specific one?

@MarshallOfSound MarshallOfSound added bug blocked/upstream Issues blocked by upstream bugs labels Feb 16, 2017
@MarshallOfSound
Copy link
Member

@soulchainer This is a known issue with yarn and optional dependencies. See yarnpkg/yarn#1435

@bendemboski
Copy link
Contributor

@MarshallOfSound couldn't this be fixed by just changing electron-installer-dmg to be an optionalDependency? Is there a reason it needs to be non-optional?

@malept
Copy link
Member

malept commented Feb 27, 2017

@bendemboski I tried it, that doesn't fix the problem.

@MarshallOfSound
Copy link
Member

It's because at the moment yarn fails loudly if dependencies of optionalDependencies fail. This is a problem on their end of things

@anaisbetts
Copy link
Contributor

Yarn is an exceptionally poor fit for Electron apps, because any yarn.lock file you generate is going to be wrong for 2 out of 3 of your target operating systems

@bendemboski
Copy link
Contributor

My company is standardized on MacOS as our dev machines, and it speeds up development quite a bit to have a yarn.lock file. We can easily tell the CI machines running other OS's to ignore the lock file, losing the benefits there, but still realizing them in our dev cycles.

I suspect that the statement "yarn is not a good choice for any project with optional dependencies" is not one that the yarn folks would want to just live with, no?

@malept
Copy link
Member

malept commented Feb 28, 2017

I would hope so, but that issue that @MarshallOfSound referenced has been open for several months. Perhaps they consider Electron apps to be an edge case?

@bendemboski
Copy link
Contributor

bendemboski commented Feb 28, 2017

Yeah, there's an old PR here that purported to fix the issue at some point. It was just closed a few hours ago, so I dropped a comment clarifying that it's definitely not fixed. Maybe some 👍 s or additional comments or something would help get it on somebody's radar?

If not, maybe I'll try opening a new PR that's up-to-date with master and has that fix, or this other proposed fix.

@malept
Copy link
Member

malept commented Feb 28, 2017

@bendemboski thanks for pushing forward on this. As someone who runs Linux as their primary dev environment, it's very much appreciated.

@bendemboski
Copy link
Contributor

Okay, hopefully yarnpkg/yarn#2811 or electron-userland/electron-installer-dmg#13 will land soon so this will stop being an issue! For the time being anybody that's hating life because of this could just check out and build my branch and run it locally (although it would be more of a pain to get it working in CI)

@retrixe
Copy link

retrixe commented Mar 7, 2017

This issue has been fixed, I confirmed it, yarnpkg/yarn#1435 is finally squashed in the latest 0.23.0 nightly :)

@weedgrease
Copy link

🎉 can anyone confirm what happens to yarn.lock? building for 3 platforms seems impossible if generating the lock on one platform.

@malept
Copy link
Member

malept commented Mar 21, 2017

@kevingelion I think @paulcbetts commented somewhere (don't remember where, sorry) that the problem you mention is a big blocker in version controlling yarn.lock for Electron apps.

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
blocked/upstream Issues blocked by upstream bugs bug
Projects
None yet
Development

No branches or pull requests

7 participants