question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot start karma - no provider for jasmine

See original GitHub issue

Hey Guys:

I’m having an issue with getting karma running (on a non angularJS project) - I’ve installed all dependencies with npm and ran the karma init my.conf.js 2 times. When I try and run karma start my.conf.js, here’s the output:

/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:27:14
at Array.forEach (native)
at start (/usr/local/lib/node_modules/karma/lib/server.js:26: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:178:12)
at Object.<anonymous> (/usr/local/lib/node_modules/karma/bin/karma:19:39)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:275:11)

I have karma-jasmine and karma-phantomjs-launcher in node_modules, is there something else that I’m doing wrong? What else can I check?

Thanks,

  • Vann

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
arunkumargcommented, Feb 22, 2016

I faced same error and tried to resolve for couple of hours.

Finally I figured out the issue. Which is “Karma module need to install LOCALLY not Globally” But you can have Karma-cli module can be installed globally.

npm uninstall karma -g
npm install karma 

# Optional
npm uninstall karma-cli
npm install karma-cli -g
2reactions
maksimrcommented, Feb 28, 2015

@aleclarson remove property plugins(then karma will by default load all plugins from node_modules by pattern karma-*) or add to it karma-jasmine.

plugins: [require("karma-webpack"), require('karma-jasmine')],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Server start failed, No provider for "framework:jasmine"
What I tried: rm node_modules, npm i; clean npm cache, rm node_modules, npm i; npm remove -g karma (although was not installed -g) ......
Read more >
angular 2 no providers in karma/jasmine testing
First I've searched for "No provider for Http", as the error was showing, but I've realised that I've imported http within ...
Read more >
Karma - It follows you around!!
I could not start karma even after installing it globally. ... Server start failed on port 9876: Error: No provider for "framework:jasmine"!
Read more >
No Provider for.. Angular 7, Jasmine + Karma issue
I'm using Angular 7, Jasmine + Karma and am getting errors when I run ng test against the project. I moved out my...
Read more >
Angular 6: Using Karma for Unit Testing | Helmut's RAC / JEE ...
Code to be tested; Karma/Jasmine Test Code; Potential Error ... Error Datails: NullInjectorError: No provider for Router!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found