Follow all below steps for run this application.
-
You need VS code application on your PC.
-
create new folder in your workspace folder.
workspace--
--Electron-calculator-app
--indo.html
--index.html
--main.js
--renderer.js
--styles.css -
Open all above files in your VS code.
-
Before proceeding with Electron you need to install Node.js. To install nodejs run below procees Go to the site https://nodejs.org/en/download/ and download the necessary binary files. In our example, we are going to download the 32-bit setup files for Node.js and install it.
-
To check that Node.js was installed correctly, type the following commands in your terminal client:
node -v
npm -v -
we need electron framework for run above calculator application.
run below command in your terminal-->
npm install --save-dev electron -
run below command for your JSON file
npm init -y
and modify your JSON file to
{
"name": "my-electron-app",
"version": "0.1.0",
"author": "your name",
"description": "My Electron app",
"main": "main.js"
} -
By default, the npm start command will run the main script with Node.js. To run the script with Electron, you need to change it as such:
add "start": "electron ." in your script which is placed in your JSON file. You just need to add. -
In terminal go to your project dir and run below command
npm start