-
Notifications
You must be signed in to change notification settings - Fork 126
Install on Bash on Ubuntu on Windows (WSL) #260
Comments
Thanks bro, you saved my day! :) |
Indeed, you have to do it for every update, but anyway this is just a hack to work around an issue with WSL that should be resolved in next updates from Microsoft. Still, I bet we could find a way to colocate Windows & Linux Electron binaries, I've seen Yarn has a sort of package aliasing system that could be a good starting point. |
Thanks for the tip. It worked for me too. I had previously installed the linux version in bash and I had to delete the |
Indeed, you could also |
You can use
Then run |
Maybe even better to avoid problems with other packages:
|
I didn't know Electron was using the |
@ClementParis016 Yes, I just tried it before posting :) Works perfectly, I did not know about this var before, was just looking into the install code from electron to find something similar then I found this var. |
Has it gotten any easier to use Electron in WSL since this was posted? This seems extremely tedious and I can't even get it to work. Granted with a vue-electron template, but still. |
Nothing new for now afaik. I guess it will always stay a bit hackish
because WSL is not a standard OS for building desktop applications. The
thing is we are executing a GUI on the Windows OS from a separated
non-graphical OS (the Ubuntu subsystem) and only this is absolutely crazy
when you think about it, so I can't see any way this could become more
practical in the future.
Le 26 oct. 2017 22:24, "David Karlsson" <[email protected]> a écrit :
… Has it gotten any easier to use Electron in WSL since this was posted?
This seems extremely tedious and I can't even get it to work. Granted with
a vue-electron template, but still.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFV5l7bRGDX9DsYdvV4us0SzgIAU4pg8ks5swOp1gaJpZM4NppYx>
.
|
Right, I didn't even think of that. |
You are an amazing human being an deserve all the praise in the world |
Provide a special installation script for installing Electron on the Windows Subsystem for Linux. Based on the work from electron-userland/electron-prebuilt#260 (comment)
I found this a bit funny now that this is actually happening. WSL2 will be able to run Linux GUI apps in Windows. https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-build-2020-summary/#wsl-gui |
After hours falling into a bunch of errors while trying to launch electron from WSL, I found the easiest way is to install electron on Windows then start it from WSL.
Steps:
cmd.exe
, move to your project directory and runnpm install electron --save-dev
.This will install the Windows version of the prebuilt Electron binary instead of the Linux one, which would occur if you try to install from WSL. (This is the actual trick)
./node_modules/.bin/electron
(or use an npm script) to launch your Electron appThough, I'm not sure this is very convenient, it seems to work well.
I hope this will help people encoutering the same issue in the future!
The text was updated successfully, but these errors were encountered: