I am very new to Angular, Javascript, etc.
I am trying to write an Angular2 -Electron (TypeScript) application that should access the file system. Everyone says the "fs" module is required, and everything is fine, but this does not work for me ....
If I do something like: var fs = require('fs');
I see that my application is trying to download this "fs" module from my application root folder: ..myapp / dist / fs net :: ERR_FILE_NOT_FOUND
All my other external modules reference index.html:
<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>
And so I think they can be found, but does "fs" belong to node.js, which is present in the electron? Or did I make some big mistakes in my thoughts?
Thank you very much,
Chris
source share