title: How to load npm modules with Karma?
body: <p>I have some unit tests that use npm modules:</p>
  
  <pre><code>import thunk from "redux-thunk";
  import * as createLogger from "redux-logger";
  import * as $ from "jquery";
  import bootstrap from "../src/index";
  import { getRoutes, getReducers } from "./stubs";
  
  let expect = chai.expect;
  
  describe("Some fixture...", () =&gt; {
  
      it("Some unit test....", () =&gt; {
  
          // ...
  </code></pre>
  
  <p>My application uses commonjs modules so I'm using the <a href="https://github.com/karma-runner/karma-commonjs" rel="nofollow"><code>karma-commonjs</code></a> plugin to load my commonjs modules.</p>
  
  <p>My problem is that <code>karma</code> is not able to find the npm modules:</p>
  
  <pre><code>PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
    Error: Could not find module 'redux-thunk'
  </code></pre>
  
  <p>When the npm modules are globals like jquery I can add the following in the <code>karma.conf.js</code>:</p>
  
  <pre><code>files : [
      { pattern: "node_modules/jquery/jquery.js", included: true },
      // ...
  ],
  </code></pre>
  
  <p>How can I get Karma to understand where to find my npm modules when they are not globals?</p>