Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No provider error" on Karma serve running angularjs phonecat tutorial

I have found and tried many solutions offered here and elsewhere: re downgrading karma version upgrading node and npm - changing order of load in the config file.... but so far nothing works. Is the problem that I am running the angular tutorial via Apache?

Starting Karma Server (http://karma-runner.github.io)

/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
            ^
Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:22:68)
    at Object.parent.get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /usr/local/lib/node_modules/karma/lib/server.js:28:14
    at Array.forEach (native)
    at start (/usr/local/lib/node_modules/karma/lib/server.js:27:21)
    at invoke (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Object.exports.start (/usr/local/lib/node_modules/karma/lib/server.js:204:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/karma/bin/karma
/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
            ^
Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:22:68)
    at Object.parent.get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /usr/local/lib/node_modules/karma/lib/server.js:28:14
    at Array.forEach (native)
    at start (/usr/local/lib/node_modules/karma/lib/server.js:27:21)
    at invoke (/usr/local/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Object.exports.start (/usr/local/lib/node_modules/karma/lib/server.js:204:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/karma/bin/karma:19:39)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3
like image 559
user1561591 Avatar asked Oct 04 '13 15:10

user1561591


3 Answers

You have to install jasmine:

    npm install -g karma-jasmine
like image 80
Harry Oosterveen Avatar answered Nov 10 '22 03:11

Harry Oosterveen


The selected answer didn´t work for me, this is what it work for me:

https://github.com/karma-runner/karma/issues/880

Karma needs to load the plugins (such as karma-jasmine). By default (if you don't specify config.plugins), Karma loads all the karma-* modules that are siblings to Karma.

It sounds like you have Karma installed globally (npm install -g karma) and jasmine plugin locally (npm install karma-jasmine). If that's the case, install Karma locally.

The recomended way is to install Karma and all the plugins locally, per project.

like image 23
Sergio López Avatar answered Nov 10 '22 01:11

Sergio López


as per the documentation following plugins are required. // these plugins will be require() by Karma 'karma-jasmine', 'karma-chrome-launcher'

So add these two to your plugin section.

like image 9
user3376228 Avatar answered Nov 10 '22 03:11

user3376228