title: fs.writeFile is not working on my ReactJs / NodeJs app
body: <p>I am trying to write some stuff in a file using reactJS and nodeJs but it doesnt work. Here is my code, is a simple one and i get that fs.writeFile is not a function. I get this error for each function that i use from fs. In node_module i have the folder for fs but inside i only have package.json and a readme. I dont know what to do, i searched online for answers but nothing. Any help would be awesome</p>
  
  <pre><code>import React, { Component } from 'react'
  
  const fs = require('fs');
  
  export default class WriteFile extends Component {
  
  write = () =&gt; {
      fs.writeFile("file.txt", "Hey there!", function(err) {
          if(err) {
              return console.log(err);
          }
  
          console.log("The file was saved!");
      }); 
  }
  
  render() {
      return (
      &lt;div&gt;
          &lt;button className='btn btn-info' onClick={this.write}&gt;scria-ti-as&lt;/button&gt;
      &lt;/div&gt;
      )
   }
  }
  </code></pre>
  
  <p>and the error</p>
  
  <pre><code>TypeError: fs.writeFile is not a function
  
  WriteFile._this.write
  
  D:/js/login_reactjs/src/components/WriteFile.js:8
  
  5 | export default class WriteFile extends Component {
  
  6 | 
  
  7 |     write = () =&gt; {
  
  8 |         fs.writeFile("file.txt", "Hey there!", function(err) {
  
  9 |             if(err) {
  
  10 |                 return console.log(err);
  
  11 |             }
  </code></pre>