Install Electron in Node.js – A Step Guide – Electron Tutorial

By | October 11, 2020

Electron can allow us to create desktop application using html and javascript. In this tutorial, we will introduce how to install it in node.js.

Preliminary

In order to install electron, you should install node.js first.

You can read this node.js installation guide.

Install Node.js in Windows 10: A Step Guide – Node.js Tutorial

After having install node.js, we can start to install electron.

Use npm install electron

The simplest way to install electron is to use command below:

npm i electron -g

install electron using node.js

However, you may get some errors:

1. If you get error: RequestError: connect ETIMEDOUT, you can read this tutorial to fix.

Fix npm install RequestError: connect ETIMEDOUT Error – Node.js Tutorial

2. If you get error: ERR EEXIST. You can refer this tutorial.

Fix npm install ERR EEXIST error: A Step Guide – Node.js Tutorial

2 thoughts on “Install Electron in Node.js – A Step Guide – Electron Tutorial

  1. Khantti Nyane

    Help me please! this is my error codes
    npm ERR! code 1
    npm ERR! path C:\Users\Khantti Nyane\AppData\Roaming\npm\node_modules\electron
    npm ERR! command failed
    npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node install.js
    npm ERR! RequestError: connect ETIMEDOUT 185.199.108.133:443
    npm ERR! at ClientRequest. (C:\Users\Khantti Nyane\AppData\Roaming\npm\node_modules\electron\node_modules\got\source\request-as-event-emitter.js:178:14)
    npm ERR! at Object.onceWrapper (node:events:510:26)
    npm ERR! at ClientRequest.emit (node:events:402:35)
    npm ERR! at ClientRequest.origin.emit (C:\Users\Khantti Nyane\AppData\Roaming\npm\node_modules\electron\node_modules\@szmarczak\http-timer\source\index.js:37:11)
    npm ERR! at TLSSocket.socketErrorListener (node:_http_client:447:9)
    npm ERR! at TLSSocket.emit (node:events:390:28)
    npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
    npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21)

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\Khantti Nyane\AppData\Local\npm-cache\_logs\2022-01-17T15_36_34_023Z-debug.log

    1. admin Post author

      The error is: RequestError: connect ETIMEDOUT 185.199.108.133:443
      Please make your network is good.

Leave a Reply