title: How to import electron in angular 5
body: <p>I am trying to import <a href="https://www.npmjs.com/package/electron" rel="nofollow noreferrer">electron</a> for printing the invoice from my app
   using </p>
  
  <pre><code>import { BrowserWindow } from 'electron'
  </code></pre>
  
  <p>But it is throwing the error.</p>
  
  <blockquote>
    <p>fs.existsSync is not a function</p>
  </blockquote>
  
  <p>Also, I have tried to require it from the index.html page like</p>
  
  <pre><code>&lt;script&gt;  
          var electron = require('electron');  
  &lt;/script&gt;
  </code></pre>
  
  <p>but getting </p>
  
  <blockquote>
    <p>require is not defined</p>
  </blockquote>