title: Node fs Error: EPERM: operation not permitted, open
body: <p>I get this error in my app:</p>
  
  <blockquote>
    <p>Error: EPERM: operation not permitted, open 'C:\Program Files
    (x86)\Full Menu\db\main.json'</p>
  </blockquote>
  
  <p>The app I have is built with electron-boilerplate. I am using this function to get the path to the root of the app:</p>
  
  <pre><code>path.dirname(process.execPath)
  </code></pre>
  
  <p>And this is the script that writes the file:</p>
  
  <pre><code>fs.writeFile(apath + '/db/' + elem + '.json', JSON.stringify(results)
  </code></pre>
  
  <p>I know what the problem is: permissions. But how could I get this working without running the app as an administrator?</p>