In a tutorial i’m following, they use the following code:
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow;
If I try this in my own app, I get a
TypeError: cannot read property 'on' of undefined when running
I found the following code when searching for a solution:
const electron = require('electron'); const app = require('app'); const BrowserWindow = require('browser-window')
The above code seems to work fine in my own app. So which way is correct, and why does the first example not work in my own app?