Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting template application - "Error: Cannot find module 'app'" #111

Open
radhewro opened this issue Jun 18, 2016 · 10 comments
Open

Starting template application - "Error: Cannot find module 'app'" #111

radhewro opened this issue Jun 18, 2016 · 10 comments

Comments

@radhewro
Copy link

  1. Downloaded "dist" zip
  2. Unzipped
  3. Opened terminal, cd to the folder "template-app"
  4. Run "electron ."
  5. Got an error: "Error: Cannot find module 'app'"

I've debuged in vs.code too, the first require("app") throws that exception.

Electron-prebuild is installed via npm/nvm.

What I'm doing wrong?

@scholtzm
Copy link

Seems like you are using Electron v1.x and template app uses older version of Electron APIs.

@radhewro
Copy link
Author

Thank you.

@radhewro
Copy link
Author

Ah, one more question: do you have any idea how to fix/workaround it?

@gadget00
Copy link

So far, you have to re-write the code of Photon so it complies with the new syntax of Electron 1.x

@scholtzm
Copy link

You could also use older version of Electron, but I would advise against that.

@radhewro
Copy link
Author

Oh, sad...thank you all!

@zephyrzoom
Copy link

It also happend to me!

@arjunmenon
Copy link

Spent more than an hour to finding out the cause. Was actually frustrating.
This seems like a common issue. Can the author put up a guide on re-writing the Photon to work with newer stable versions?

@sercheo87
Copy link

The error is solvent with replace the next section in file app.js

var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window.

with

const {app, BrowserWindow} = require('electron');

@samuelyeshua
Copy link
Contributor

#117 This was solved in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants