title: Electron, Angular2, "fs"
body: <p>I am very new to the topic of Angular, Javascript etc.</p>
  
  <p>I try to write a (TypeScript) Angular2-Electron application which should access the file-system. Everyone just says to require the "fs" module and all is fine, but that doesn't work for me... .</p>
  
  <p>If I do something like: <code>var fs = require('fs');</code></p>
  
  <p>I can see that my app tries to load that "fs" module from my app root folder:
  ..myapp/dist/fs net::ERR_FILE_NOT_FOUND</p>
  
  <p>All my other external modules are referenced in the index.html:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;!-- build:js app/scripts/combined.js --&gt;
      &lt;script src="../node_modules/jquery/dist/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular2/bundles/angular2-polyfills.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/systemjs/dist/system.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular2/bundles/angular2.dev.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular2/bundles/http.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular2/bundles/router.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/rxjs/bundles/Rx.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/bootstrap/dist/js/bootstrap.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/pdfjs-dist/build/pdf.combined.js"&gt;&lt;/script&gt;
      &lt;script src="boot.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;!-- endbuild --&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And therefore I think they could be found, but "fs" belongs to node.js which is present in electron? Or have I made some big mistakes in my thoughts?</p>
  
  <p>Thanks a lot,<br>
  Chris</p>