on given folder , create package.json file with given code below
{
"name": "myapp",
"version": "0.1.0",
"main": "index.js",
"scripts": {
"start": "electron ."
},
"author": "Mitul Dabhi <dabhi.mitul.developer@gmail.com> (http://gmail.com)",
"license": "MIT",
"devDependencies": {
"electron-packager": "^8.6.0",
"electron-prebuilt": "^0.25.3"
},
"description": ""
}
now open command prompt ,
on current folder run following command
npm i electron-prebuilt --save-dev
it will install "electron-prebuilt": "^0.25.3" as per package.json
now create index.js because as per package.json , "main": "index.js" , index.js is the landing file to load .
index.js
var app = require('app');
var browserWindow = require('browser-window');
app.on('ready',function(){
var mainWindow = new browserWindow({
width : 800 , height : 600
});
});
now run command on command prompt as belowed
npm start
it prompt a window