title: Running electron as root on Linux
body: <p>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.</p>
  
  <p>When I run <code>electron .</code> in the folder, the app opens fine but then says (in the terminal):</p>
  
  <p><code>wiringPiSetup: Must be root. (Did you forget sudo?)</code></p>
  
  <p>However when I try <code>sudo electron .</code>, I get an error:</p>
  
  <p><code>sudo: electron: command not found</code></p>
  
  <p>Does anyone know why this is happening?
  Also, for the record, the same thing happens when I run npm as root:</p>
  
  <pre><code>pi@raspberrypi:~/rubiks-robot $ sudo npm
  sudo: npm: command not found
  </code></pre>
  
  <p>Any ideas of how I can fix this issue and run Electron as root?</p>