First launch of electron



I have followed the steps in the quick start guide, but, when I launch electron, I have the following error :

> electron .

	    util = core.require('util'),
TypeError: core.require is not a function
    at Object.<anonymous> (/Users/herzuull/node_modules/app/lib/App.js:10:18)
    at Object.<anonymous> (/Users/herzuull/node_modules/app/lib/App.js:356:4)
    at Module._compile (module.js:418:26)
    at Object.Module._extensions..js (module.js:436:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:298:12)
    at Module.require (module.js:353:17)
    at require (module.js:372:17)
    at Object.<anonymous> (/Users/herzuull/node_modules/app/lib/index.js:3:29)
    at Object.<anonymous> (/Users/herzuull/node_modules/app/lib/index.js:7:4)

For your information I have installed electron-prebuilt in my current project folder
I have installed my in my Applications/ folder
My package.json

  "name": "MyApp",
  "version": "1.0.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  "author": "Me"

I launch my app with $> npm start.
I’m on the latest version of Electron.

Any idea ? :smile:

Thanks a lot.


I had the same problem, and I solved it by

  1. removing the node_modules directory
  2. npm install

and that fixed it for me.