UPDATE:
A similar question has been asked and my answer would most probably help you here:
If you don't append the path to your app node_modules
directory under your app root to the NODE_PATH
variable it is not going to work. So you need to do something like this:
export NODE_PATH=/PATH/TO/APP/node_modules
electron /PATH/TO/APP
When exporting NODE_PATH
make sure that you provide an absolute path.
If electron cannot find modules when you
require
them normally, it's a sign that your
package.json
doesn't contain the modules as dependency
even if the module is already available under your
dist
directory.
So make sure that you are inside dist
directory and use
npm install --save xyz
note the --save
flag!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…