karma: Strange error trying to run Jasmine specs
callum:tool-test $ gulp test
[gulp] Using file /Users/madebymany/tool-test/gulpfile.js
[gulp] Working directory changed to /Users/madebymany/tool-test
[gulp] Running 'scripts'...
[gulp] Finished 'scripts' in 4.52 ms
[gulp] Running 'test'...
/Users/madebymany/tool-test/src/main.js
[gulp] Starting Karma server...
/Users/madebymany/tool-test/node_modules/gulp-karma/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 (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/node_modules/di/lib/injector.js:22:68)
at Object.parent.get (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/node_modules/di/lib/injector.js:9:13)
at get (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/node_modules/di/lib/injector.js:54:19)
at /Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/lib/server.js:29:14
at Array.forEach (native)
at start (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/lib/server.js:28:21)
at invoke (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/node_modules/di/lib/injector.js:75:15)
at Object.exports.start (/Users/madebymany/tool-test/node_modules/gulp-karma/node_modules/karma/lib/server.js:272:12)
at Object.<anonymous> (/Users/madebymany/tool-test/node_modules/gulp-karma/lib/background.js:3:8)
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:902:3
[gulp] Finished 'test' in 566 ms
I have tried reinstalling Karma and associated modules. Explicitly installing karma-jasmine didn’t seem to work (http://stackoverflow.com/questions/19185548/no-provider-error-on-karma-serve-running-angularjs-phonecat-tutorial).
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 24 (5 by maintainers)
I had the same problem. Adding ‘karma-jasmine’, ‘karma-chrome-launcher’ in the plugins fixed it.
Yes removed global karma then installed karma-cli globally. thereafter i installed karma local to project and then runned karma.
Thanks
@garora Try remove global
karmaand installkarma-cliglobal. Then installkarmalocal to the project and runkarma.Thanks
Karma needs to load the plugins (such as
karma-jasmine). By default (if you don’t specifyconfig.plugins), Karma loads all thekarma-*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.
I resolved this problem with this conf:
by the way, i also get:
with:
and I also resolved this problem with:
maybe this will help somebody.