//First install the remote module using
> npm install @electron/remote
//In the new versions of electron, you have to include remote in renderer as:
const remote = require('@electron/remote');
const { net } = remote;
//And in your main.js file add the following
const remoteMain = require('@electron/remote/main');
remoteMain.initialize();
//Also, after creating the mainWindow object
remoteMain.enable(mainWindow.webContents)