I am not able to use the File System module of Nodejs. I have gone through many forums - applied the suggested fixes - and I'm still not able to use fs.
My config.js file includes this as is suggested by https://github.com/request/request/issues/1529 :
node: {
console: true,
fs: 'empty',
net: 'empty',
tls: 'empty'
},
This is my main file:
...
var fs = require('fs');
...
onGo(e){
e.preventDefault();
var json = {
foo: 'bar',
qux: 'moo',
poo: 123
}
var xls = json2xls(json);
//everything runs smoothly right until here
fs.writeFileSync('data.xlsx', xls); //fs is where trouble ensues
}
I have tried using fs.write/fs.writeFile/etc but 'fs' is always generating a typeerror.
Please help me. Thanks.
No need for serverside code. Solution: