DEV Community

Cover image for Electron JS Windows setup
LoganVoisin
LoganVoisin

Posted on

Electron JS Windows setup

I’ve had this one terrible problem a long time ago where I could not for the life of me get electron js to work on windows. So, here I am to help anyone else who may be struggling like I was. I hope this can help more than the articles I read.
Okay first up we’ll need node.js that is a must, like in all js projects. Then what well have to do is go to the official electron site to get the download command (you can see it below)

Image description
Then you’ll want to have a github account and git installed on your machine.
That covers the prerequisites, now to get into the meat of the topic. When using wsl and windows in combination with electron js there is one step that I missed the first time I installed electron for a project. Here was my pitfall, I missed a crucial step when I was installing electronJS. I was using wsl2! In the instructions to download electron js it specifically warns against this, so use power shell.
So the first steps to getting things tetup is having a directory you want lectron in, we can do this my running this little command here: mkdir my-electron-app && cd my-electron-app
After you run that command you can run npm init. Once that is finished run:npm install electron --save-dev
Then that's all to the setup.The rest of the basics you will need to actually get familiar with electron can be found in the electronjs official site. Thank you for taking the time to read this short article.

https://www.electronjs.org/docs/latest/tutorial/tutorial-first-app

Top comments (0)