Friday, 26 May 2017

Electron - TypeError: core.require is not a function

I am just trying out electron and have a very simple app that should load a webpage when running npm start

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

app.on('ready', function() {

    var window = new BrowserWindow({

        height : 750,
        width: 1000,
        frame: false

    });

    window.loadUrl('https://google.com');
});

But I get the error : TypeError: core.require is not a function

The commands I run are:

  1. npm install electron-prebuilt
  2. npm install app
  3. npm install browser-window

My package.json is:

{
    "name": "SimpleWeb",
    "version" : "0.0.2",
    "main" : "main.js",
    "scripts" : {
        "start" : "electron ."
    }
}

I am not sure why I am getting the crash - could someone help me out here :-)



via Jeff Kranenburg

No comments:

Post a Comment