title: Install imdb-api and use it in Angular2 Webpack
body: <p>I am trying to use the <strong>imdb-api</strong> repo <strong>(<a href="https://github.com/worr/node-imdb-api" rel="nofollow">https://github.com/worr/node-imdb-api</a>)</strong> in my angular2 project, but can't seem to get it working.</p>
  
  <p>I'm working on the newest angular2 webpack <a href="https://github.com/AngularClass/angular2-webpack-starter" rel="nofollow">(Angular2 Webpack Starter)</a>. I usually know how to get libs working, but this one is just not working :(</p>
  
  <p>Have cloned the Angular2 Webpack starter, and made the Npm install and npm start.. everything works great.</p>
  
  <p>Then I have installed version 2.0.0 of imdb-api like this:</p>
  
  <pre><code>npm install --save imdb-api
  </code></pre>
  
  <p>It installed with no problems.</p>
  
  <p>In a component, (lets say the about component) , I have imported the module like:</p>
  
  <pre><code>import * as imdb from 'imdb-api';
  </code></pre>
  
  <p>In the constructor, I am trying to console.log(imdb) to see if it's available.</p>
  
  <pre><code>constructor(public route: ActivatedRoute) {
      // var imdb = require('imdb-api');
      console.log(imdb);
  }
  </code></pre>
  
  <p>As you see, I also tried using the <strong>var imdb = require ...</strong></p>
  
  <p>The problem is all this gives me errors I just can't seem to solve. I am getting the following errors:</p>
  
  <pre><code>ERROR in ./~/request/lib/har.js
  Module not found: Error: Can't resolve 'fs' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\request\lib'
  
  ERROR in ./~/forever-agent/index.js
  Module not found: Error: Can't resolve 'net' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\forever-agent'
  
  ERROR in ./~/forever-agent/index.js
  Module not found: Error: Can't resolve 'tls' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\forever-agent'
  
  ERROR in ./~/tough-cookie/lib/cookie.js
  Module not found: Error: Can't resolve 'net' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\tough-cookie\lib'
  
  ERROR in ./~/tunnel-agent/index.js
  Module not found: Error: Can't resolve 'net' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\tunnel-agent'
  
  ERROR in ./~/tunnel-agent/index.js
  Module not found: Error: Can't resolve 'tls' in 'C:\Users\Mikkel\Documents\Programmering\angular2-webpack-starter\node_modules\tunnel-agent'
  </code></pre>
  
  <p>I have found a post about the request problem. The imdb-api is using the request-promise, thats why I'm getting the error.</p>
  
  <p>The post you find here: <a href="https://github.com/request/request/issues/1529" rel="nofollow">https://github.com/request/request/issues/1529</a></p>
  
  <p>The suggested to add the following:</p>
  
  <pre><code>console: 'empty',
  fs: 'empty',
  net: 'empty',
  tls: 'empty'
  </code></pre>
  
  <p>to the node object in the webpack.config.js file. Have added it to the webpack dev config, but now I don't see any errors at all, but the application wont load.</p>