-
-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run electron-forge on the Linux Subsystem for Windows (WSL) #548
Comments
I think this is expected behavior. If I remember correctly, WSL is effectively a virtualized Linux. |
Yes - But there has to be a way to fix this (especially because there is a workaround when using vanilla electron which for some reason doesnt work here..) |
I don't know whether we'd want to add a bunch of detection code just for WSL users. I don't even know if Forge is the right place to have that code. |
Electron tests typically need an X11 server running, it looks like you don't have one - try running this with vcxsrv running and configured correctly |
I've talked to some Electron devs who are more familiar with the Windows environment than I am, and the consensus is that you should be using WSL + Forge just to package for Linux (i.e., |
Ok, thanks for the feedback - even though I disagree. Linux has, by far, the more advanced ecosystem for software development. I would much rather use it than having to use a crappy OS like windows for development. |
As Paul said, you'll need an X server running if you want to run an Electron app under WSL without a lot of headaches (which uses the Linux target, because you're technically running under Linux). Feel free to try to figure out how to get a Forge project with a Windows target working (I would suggest using the v6 beta instead of v5, if only because we're not adding any new features to v5), and if it ends up being a relatively clean solution (unlike that fourth bullet point in your repro instructions), you should definitely file an issue/PR in the appropriate project. |
I've been developing Electron apps from within WSL2 (Ubuntu 22.04) for some time. The following steps work with electron-forge (and other Electron frameworks):
|
electron-forge does not work on the WSL by default. This is expected since WSL can't run GUI applications on linux.
When using "vanilla" electron through the WSL manually installing the win32 version of electron fixes this issue. (see here)
Unfortunatly, this approach results in this error when using electron-forge
It seems like the reinstalling of electron had no effect - even though im unsure why this is happening.
Instructions to reproduce:
electron-forge init test ; cd test
npm install && npm uninstall electron && export npm_config_platform=win32 && npm install electron && unset npm_config_platform
npm start
The text was updated successfully, but these errors were encountered: