当我尝试开始业力时,我会收到以下错误:
C:\*>karma start karma.conf.js
C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:jasmine"! (Resolving: framework:requirejs)
at error (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:22:
at Object.parent.get (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\inj
at get (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:54:19
at C:\Users\*\AppData\Roaming\npm\node_modules\karma\lib\server.js:31:14
at Array.forEach (native)
at start (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\server.js:30:21)
at invoke (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:75
at Object.exports.start (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\server.js:314:12
at Object.exports.run (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\cli.js:229:25)
at requireCliAndRun (C:\Users\*\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:24:16)
我已经检查过我是否安装了茉莉花:
C:\*>npm jasmine --version
1.4.28
和Karma:
C:\*>karma --version
Karma version: 0.12.31
并且还有更多教程,但无法解决此错误,有人可以帮助我吗?
答案 0 :(得分:6)
看起来您需要将依赖项安装到jasmine。试试:
npm install karma-jasmine
此外,您需要在配置文件中的插件数组中添加配置karma-jasmine
:
// list of karma plugins
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher',
'karma-requirejs',
'karma-jasmine'
]