Use JS library xml2js with Angular 2
<p>I´m trying to use xml2js as XML parser within an Angular 2 (RC 1 with TypeScript) webapplication. However I only get some errors and no working solution.  </p>

<p>Here is what I did step by step:</p>

<ul>
<li>installed xml2js via <code>npm install xml2js</code></li>
<li>installed according d.ts-file via <code>tsd install xml2js</code></li>
<li>included script link to my index.html: <code>&lt;script src="../node_modules/xml2js/lib/xml2js.js"&gt;&lt;/script&gt;</code></li>
<li>configured SystemJS by adding <code>'xml2js': '../node_modules/xml2js'</code> to map and <code>'xml2js': { defaultExtension: 'js' }</code> to packages</li>
<li>import Parser of xml2js in my component via <code>import {Parser} from 'xml2js';</code></li>
<li>try using it in constructor of component:<br>
<code>var parser = new Parser();
 var xml = "&lt;root&gt;Hello xml2js!&lt;/root&gt;"
 parser.parseString(xml, function (err, result) {
    console.dir(result);
});</code>  </li>
</ul>

<p>This is what browser console tells me when opening a webpage containing the component:</p>

<blockquote>
  <p>module.js:440 Uncaught Error: Cannot find module 'sax'  </p>
</blockquote>

<p>and  </p>

<blockquote>
  <p>GET file:///C:/xxx/source/node_modules/xml2js net::ERR_FILE_NOT_FOUND</p>
</blockquote>

<p>as well as</p>

<blockquote>
  <p>index.html:17 Error: Error: XHR error loading file:///C:/xxx/source/node_modules/xml2js<br>
          at ZoneDelegate.invokeTask (file:///C:/xxx/source/node_modules/zone.js/dist/zone.js:356:38)<br>
          at Zone.runTask (file:///C:/xxx/source/node_modules/zone.js/dist/zone.js:256:48)<br>
          at XMLHttpRequest.ZoneTask.invoke (file:///C:/xxx/source/node_modules/zone.js/dist/zone.js:423:34)<br>
      Error loading file:///C:/xxx/source/node_modules/xml2js as "xml2js" from file:///C:/xxx/source/frontend/angular/components/mycomponent/mycomponent.js</p>
</blockquote>

<p>"sax" is located in <code>node_modules/xml2js/node_modules/sax</code> as installed via npm.
What did I miss installing the external library? Is there a "better" way to use external JS libraries with Angular 2 &amp; TypeScript?</p>