cannot find module in electron prebuilt 1.x but in 0.x (0.2 and 0.3 -


i have small code, run in electron (using prebuild 0.3.5, , 0.25).

i upgrade electron prebuild 1.1.0 , 1.2.0

i got error

uncaught exception: error: cannot find module 'app' @ module._resolvefilename (module.js:438:15) @ function.module._resolvefilename (/home/mervo/electron/midas-tron/node_modules/electron-prebuilt/dist/resources/electron.asar/common/reset-search-paths.js:47:12) @ function.module._load (module.js:386:25) @ module.require (module.js:466:17) @ require (internal/module.js:20:19) @ object. (/ho

i think there change in structure in 1.x, dont know, can help?

the correct way require app module in electron v1.0.0+ is:

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

the same applies other built-in electron module require directly.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -