title: Requiring a JavaScript Node.js module in TypeScript (allowJs' is not set)
body: <p>I have an Angular2 app inside Electron. Now, I would like to use the <code>@pokusew/pcsclite</code> library to use NFC functionality. This library uses native Node.js modules.</p>
  
  <p>When I try to <em>require</em> the library in my component.ts like this:</p>
  
  <pre><code>declare var pcsclite: any;
  var pcsclite = require('../../../node_modules/@pokusew/pcsclite/');
  </code></pre>
  
  <p>I get and error that says:</p>
  
  <blockquote>
    <p>error TS6143: Module '../..' was resolved to '../../lib/pcsclite.js', but '--allowJs' is not set.</p>
  </blockquote>
  
  <p>On the other hand, if I try to import the library via a &lt;\script>-Tag in the index.html I get an error that says:</p>
  
  <blockquote>
    <p><strong>ZoneAwareError</strong> Error: Could not locate the bindings file. Tried:...</p>
  </blockquote>
  
  <p>Finally, if I <code>var pcsclite = require('@pokusew/pcsclite');</code> in the <code>main.js</code>, then it works, but then I don't have access to it from inside my Angular app.</p>