connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10k stars 577 forks source link

no fount module app #158

Open zerotrzy opened 3 years ago

zerotrzy commented 3 years ago
Error: Cannot find module 'app'
Require stack:
- /photon-0.1.2-dist/template-app/app.js
- /photon-0.1.2-dist/template-app/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:961:15)
    at Function.o._resolveFilename (electron/js2c/browser_init.js:257:919)
    at Module._load (internal/modules/cjs/loader.js:844:27)
    at Function.Module._load (electron/js2c/asar.js:769:28)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/mnt/i/home/electr/photon-0.1.2-dist/template-app/app.js:1:11)
    at Module._compile (internal/modules/cjs/loader.js:1145:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1166:10)
    at Module.load (internal/modules/cjs/loader.js:981:32)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot 

if I change to require('electron').app it still not working

yarn ok yarn start have this trouble.

longmaba commented 3 years ago

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

Use this instead

alexchandel commented 3 years ago

Please close this issue, repo is dead, see #142