As someone who is unfamiliar with Angular and Javascript, I am attempting to create a TypeScript Angular2-Electron application that requires access to the file system. Most advice I receive suggests simply requiring the "fs" module, but this approach is not working for me.
When I try using var fs = require('fs');
, my app attempts to load the "fs" module from the root folder of my application resulting in an error message: ..myapp/dist/fs net::ERR_FILE_NOT_FOUND
All my other external modules are properly referenced in the index.html:
<!-- build:js app/scripts/combined.js -->
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="../node_modules/systemjs/dist/system.js"></script>
<script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="../node_modules/angular2/bundles/http.js"></script>
<script src="../node_modules/angular2/bundles/router.js"></script>
<script src="../node_modules/rxjs/bundles/Rx.js"></script>
<script src="../node_modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="../node_modules/pdfjs-dist/build/pdf.combined.js"></script>
<script src="boot.js" type="text/javascript"></script>
<!-- endbuild -->
I suspect that while these modules can be found, "fs" belongs to node.js which is integrated with electron. Could there be a mistake in my understanding?
Thank you,
Chris