title: Download a .docx file from NodeJS Server using Express
body: <p>I am trying to prompt the user for file download using express's res.download but it does not seem to work and gives an error in the console.</p>
  
  <p>Here is my code</p>
  
  <pre><code>router.get('/download', function(req, res){
  
      var file = __dirname + '/public/template.docx';
      res.download(file);
  
  });
  </code></pre>
  
  <p>Which gives me the following error</p>
  
  <blockquote>
    <p>ERROR SyntaxError: Unexpected token P in JSON at position 0</p>
  </blockquote>