Require electron from node_modules of a parent directory


#1

Is it possible to require the electron package from a node_modules folder that exists on a parent directory above the main.js? Below is my folder structure:

When I execute electron, I get the following error:

Thanks


#2

Are you talking about the electron package on NPM or the built-in electron module referenced in the Electron docs? Accidentally installing the NPM package (which has nothing to do with Electron) was a common source of errors for new users prior to Electron v1.1.2.


#3

I am referring to the electron-prebuild module.


#4

The error was due to absence of package.json file. Specifically, Electron could not find the main.js file to load, which is declared in the json file.

Thanks for your help anyway!