electron-require icon indicating copy to clipboard operation
electron-require copied to clipboard

root should probably be initialized to process.cwd()

Open nem035 opened this issue 8 years ago • 2 comments

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.

nem035 avatar Nov 06 '16 04:11 nem035

Thanks for reporting. I'm not sure process.cwd() is very reliable, I will look into this when I have time.

brrd avatar Nov 07 '16 08:11 brrd

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?

brrd avatar Nov 07 '16 19:11 brrd