electron-require
electron-require copied to clipboard
root should probably be initialized to process.cwd()
Properties set inside package.json
get ignored because the code tries to require("package.json")
relative to the working directory of this project (as seen here).
This leads to loading of the wrong file when installing this project from npm
.
The code loads path/to/project/node_modules/electron-require/package.json
instead of path/to/project/package.json
.
Thanks for reporting. I'm not sure process.cwd()
is very reliable, I will look into this when I have time.
I can't reproduce this bug. In my case the good package.json is loaded, even if the module is installed from npm.
Could you give more details please: your OS, platform, node/npm/electron versions, which process (renderer/main), error messages and, if possible, a better description of what you did to get the error?