Coder Social home page Coder Social logo

Comments (13)

dougmaitelli avatar dougmaitelli commented on August 11, 2024 39

Maybe even better to avoid problems with other packages:

"install-wsl": "npm install && npm uninstall electron && export npm_config_platform=win32 && npm install electron && unset npm_config_platform"

from electron-prebuilt.

dougmaitelli avatar dougmaitelli commented on August 11, 2024 8

You can use npm_config_platform environment variable to force Ubuntu Bash on Windows to install correct version:

"scripts": {
    "install-wsl": "export npm_config_platform=win32 && npm install",

Then run npm run install-wsl

from electron-prebuilt.

DanMossa avatar DanMossa commented on August 11, 2024 8

You are an amazing human being an deserve all the praise in the world

from electron-prebuilt.

thernstig avatar thernstig commented on August 11, 2024 2

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 .

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

from electron-prebuilt.

valorad avatar valorad commented on August 11, 2024 1

Thanks bro, you saved my day! :)
Currently haven't found any incompatibility yet (v1.7.3), but have to delete Linux version of electron and then install Windows version manually every time after package upgrades.

from electron-prebuilt.

ClementParis016 avatar ClementParis016 commented on August 11, 2024

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.

from electron-prebuilt.

PierBover avatar PierBover commented on August 11, 2024

Thanks for the tip. It worked for me too.

I had previously installed the linux version in bash and I had to delete the node_modules/electron folder and the install from Windows CMD.

from electron-prebuilt.

ClementParis016 avatar ClementParis016 commented on August 11, 2024

Indeed, you could also npm uninstall electron then npm install electron

from electron-prebuilt.

ClementParis016 avatar ClementParis016 commented on August 11, 2024

I didn't know Electron was using the npm_config_platform var.
That's smart @dougmaitelli , have you tried it? It makes complete sense to tweak the platform var though.

from electron-prebuilt.

dougmaitelli avatar dougmaitelli commented on August 11, 2024

@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.

from electron-prebuilt.

daphen avatar daphen commented on August 11, 2024

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.

from electron-prebuilt.

ClementParis016 avatar ClementParis016 commented on August 11, 2024

from electron-prebuilt.

daphen avatar daphen commented on August 11, 2024

Right, I didn't even think of that.
Thanks.

from electron-prebuilt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.