Comments (13)
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.
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.
You are an amazing human being an deserve all the praise in the world
from electron-prebuilt.
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.
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.
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.
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.
Indeed, you could also npm uninstall electron
then npm install electron
from electron-prebuilt.
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.
@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.
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.
from electron-prebuilt.
Right, I didn't even think of that.
Thanks.
from electron-prebuilt.
Related Issues (20)
- OpenBSD as a supportet platform? HOT 2
- Unable to install Electron with the quick-start tutorial HOT 7
- "sudo npm install -g electron" fails HOT 1
- Electron not installing (Windows 10) HOT 2
- Got stuck after npm install -g HOT 1
- Error while installing npm in windows 10 HOT 1
- Mac: Failed at the [email protected] postinstall script 'node install.js'. HOT 4
- npm install hangs HOT 3
- Dependency to @types/node makes electron package incompatible with typescript projects not using commonjs HOT 11
- Can't install electron 1.7.1 locally using npm 5 HOT 10
- Postinstall script failing HOT 22
- Error: Generated checksum for "electron-v1.4.13-linux-x64.zip" did not match expected checksum. HOT 11
- Prebuilt electron package for Ubuntu 10.04 32 bits HOT 1
- node (vs. nodejs) is required when installing electron HOT 5
- Can't install in Windows10 HOT 1
- Change electron binary path via environment variable? HOT 2
- Electron not installing on Mac Os High Sierra HOT 1
- npm ERR! [email protected] postinstall
- Error while installing electron on Mac
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-prebuilt.