Friday, 5 May 2017

Running electron as root on Linux

I am making an application with electron which uses the wiring-pi library. This needs access to the GPIO on my Raspberry Pi, which requires root.

When I run electron . in the folder, the app opens fine but then says (in the terminal):

wiringPiSetup: Must be root. (Did you forget sudo?)

However when I try sudo electron ., I get an error:

sudo: electron: command not found

Does anyone know why this is happening? Also, for the record, the same thing happens when I run npm as root:

pi@raspberrypi:~/rubiks-robot $ sudo npm
sudo: npm: command not found

Any ideas of how I can fix this issue and run Electron as root?



via Booligoosh

No comments:

Post a Comment