Vaibhav Sharma Vaibhav Sharma - 1 year ago 191
Javascript Question

I'm getting an error while running main.js. " Cannot find module 'app' ". Could anyone help me out


Hello World!

'use strict';

var app = require('app');
var BrowserWindow = require('browser-window');

var mainWindow = null;

app.on('ready', function() {
mainWindow = new BrowserWindow({
height: 600,
width: 800

mainWindow.loadUrl('file://' + __dirname + '/app/index.html');


Answer Source


Built-in modules are now grouped into one module, instead of being separated into independent modules, so you can use them without conflicts with other modules:

var app = require('electron').app
var BrowserWindow = require('electron').BrowserWindow

Also loadUrl() was renamed to loadURL()