title: Ng test throws an error Cannot find module 'angular-cli/plugins/karma'
body: <p>Using angular-cli trying to write a test for a service after executing <strong>ng test</strong>. I get this error:</p>
  
  <pre><code>02 03 2017 14:51:09.486:ERROR [config]: Error in config file!
   { Error: Cannot find module 'angular-cli/plugins/karma'
      at Function.Module._resolveFilename (module.js:469:15)
      at Function.Module._load (module.js:417:25)
      at Module.require (module.js:497:17)
      at require (internal/module.js:20:19)
      at module.exports (/Desktop/e2-frontend/karma.conf.js:12:7)
      at Object.parseConfig (/Desktop/e2-frontend/node_modules/karma/lib/config.js:342:5)
      at new Server (/Desktop/e2-frontend/node_modules/karma/lib/server.js:56:20)
      at Promise (/Desktop/e2-frontend/node_modules/@angular/cli/tasks/test.js:34:33)
      at Class.run (/Desktop/e2-frontend/node_modules/@angular/cli/tasks/test.js:15:16)
      at Class.run (/Desktop/e2-frontend/node_modules/@angular/cli/commands/test.js:106:25)
      at Class.&lt;anonymous&gt; (/Desktop/e2-frontend/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
      at process._tickCallback (internal/process/next_tick.js:103:7) code: 'MODULE_NOT_FOUND' }
  </code></pre>
  
  <p><strong>karma.config.js</strong></p>
  
  <pre><code>    // Karma configuration file, see link for more information
  // https://karma-runner.github.io/0.13/config/configuration-file.html
  
  module.exports = function (config) {
    config.set({
      basePath: '',
      frameworks: ['jasmine', 'angular-cli'],
      plugins: [
        require('karma-jasmine'),
        require('karma-chrome-launcher'),
        require('karma-remap-istanbul'),
        require('angular-cli/plugins/karma')
      ],
      files: [
        { pattern: './src/test.ts', watched: false }
      ],
      preprocessors: {
        './src/test.ts': ['angular-cli']
      },
      mime: {
        'text/x-typescript': ['ts','tsx']
      },
      remapIstanbulReporter: {
        reports: {
          html: 'coverage',
          lcovonly: './coverage/coverage.lcov'
        }
      },
      angularCli: {
        config: './angular-cli.json',
        environment: 'dev'
      },
      reporters: config.angularCli &amp;&amp; config.angularCli.codeCoverage
                ? ['progress', 'karma-remap-istanbul']
                : ['progress'],
      port: 9876,
      colors: true,
      logLevel: config.LOG_INFO,
      autoWatch: true,
      browsers: ['Chrome'],
      singleRun: false
    });
  };
  </code></pre>
  
  <p>It seems like it cannot find karma for some reason. there has to be a different location for it.
  How can I fix this error?</p>