title: Node FS.existsSync returning false on a file that exists
body: <p>I'm currently trying to find out if a file exists before I run fs.appendFile() so that I can determine if I need to insert some text at the beginning of the document, or if I need to insert a line break.</p>
  
  <p>I've written a function that when I debug it outside of the electron (this is for an electron app) process fs.existsSync returns true or false as expected. However, when I run this in the app, it only returns false, regardless of if it actually does exist or not.</p>
  
  <pre><code>function foo(){
      const USER = process.env['USERPROFILE'].split(path.sep)[2];
      const fpath = `C:/Users/${USER}/OneDrive/dir/filename.txt`;
      let text = "text";
      const exists = fs.existsSync(fpath);
      console.log(exists); // false no matter what
      if(!exists){
          text = "foo";
      }else{
          text = "bar";
      }
      fs.appendFile(fpath, myob_import_text, (err) =&gt; { // Only ever adds "foo" to the document.
          if(err) throw err;
      });  
  }
  </code></pre>
  
  <p>I assume this has something to do with running inside the context of electron vs running in just a node environment, but I can't figure out how to work around this, so any help would be appreciated.</p>