2

As soon as I try to add

    plugins: [
      'karma-jasmine',
      'karma-mocha-reporter'
    ],

to my karma.config.js

I get this error:

C:\git\angularjs\.bin>karma start karma.config.js
11 11 2015 15:21:10.617:WARN [plugin]: Cannot find plugin "karma-mocha-reporter".
  Did you forget to install it ?
  npm install karma-mocha-reporter --save-dev
11 11 2015 15:21:10.671:INFO [karma]: Karma v0.13.14 server started at http://localhost:9876/
11 11 2015 15:21:10.672:WARN [launcher]: Can not load "Chrome", it is not registered!
  Perhaps you are missing some plugin?

obviously I tried running the

npm install karma-mocha-reporter --save-dev

also globally installing it

npm install karma-mocha-reporter --save-dev -g

and it installs fine. But still I keep getting the error messages when I launch karma. Is it installing in the wrong location or something?

ganjan
  • 7,356
  • 24
  • 82
  • 133

2 Answers2

4

You need to add the karma-chrome-launcher plugin in the plugins array:

plugins: [
  'karma-jasmine',
  'karma-mocha-reporter',
  'karma-chrome-launcher'
],

How I answered here, I think that you installed the karma-mocha-reporter plugin globally.

Try to install karma-mocha-reporter using the link flag:

npm install karma-mocha-reporter --save-dev --link
Community
  • 1
  • 1
valdeci
  • 13,962
  • 6
  • 55
  • 80
0

I think you also want karma-chrome-launcher

Try

npm install --save-dev karma-chrome-launcher
JMK
  • 27,273
  • 52
  • 163
  • 280