and I was getting this error: Cannot find module '../node_modules/electron'
I fixed it by changing the line above to electronPath: require('electron'), and everything worked.
More details about how I set everything up in my environment:
I followed the steps from the node-red tutorial and in my project directory hello-world:
git clone https://github.com/node-red/node-red.git
cd node-red
npm install
at first, I tried going to ~/.node-red and running npm install node-red-contrib-nbrowser, and then going back to my hello-world directory and that's when I got the error the first time.
I then tried running npm install node-red-contrib-nbrowser in my hello-world directory, and I made sure the right modules were available in the node_modules folder under hello_world, but somehow I was still getting the same error.
Eventually, after messing around with the actual code that required electron, I was able to get everything to work. Hope this helps you reproduce the issue on your end. :)
I was having issue with this line:
and I was getting this error:
Cannot find module '../node_modules/electron'
I fixed it by changing the line above to
electronPath: require('electron'),
and everything worked.More details about how I set everything up in my environment:
I followed the steps from the node-red tutorial and in my project directory
hello-world
:at first, I tried going to
~/.node-red
and runningnpm install node-red-contrib-nbrowser
, and then going back to myhello-world
directory and that's when I got the error the first time.I then tried running
npm install node-red-contrib-nbrowser
in myhello-world
directory, and I made sure the right modules were available in thenode_modules
folder underhello_world
, but somehow I was still getting the same error.Eventually, after messing around with the actual code that required
electron
, I was able to get everything to work. Hope this helps you reproduce the issue on your end. :)