错误:没有“framework:jasmine"的提供者!(解决:框架:茉莉) [英] Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
问题描述
我已经在我的 Windows 控制台上运行:
I have run on my windows console:
npm install -g yo grunt-cli bower
npm install -g generator-angular
yo angular
然后我使用 webstorm 开始我的项目,并在项目资源管理器中右键单击 karma.conf.js 文件,其中我有菜单项运行 karma.conf.js"并启动 karma runner.然后我得到了他的例外:
Then I started my project with webstorm and did right click on the karma.conf.js file in the project explorer where I have the menu item 'Run karma.conf.js' and start the karma runner. Then I get his exception:
...app
ode_moduleskarma
ode_modulesdilibinjector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
然后在我阅读的控制台中,我也可以使用--force,所以我尝试了一下:grunt --force
Then in the console I read I can also use --force so I tried it: grunt --force
花了一些时间,但似乎没有更多错误.哎呀为什么 --force 安装提供程序???这是在 CMD 中测试的.
It took some time but there seemed to be no more errors. Heck why does --force install a provider ??? THIS was TESTED in the CMD.
grunt serve 现在工作了,它用启动应用程序启动了我的浏览器.
grunt serve now worked and it started my browser with the starting app.
那么 --force 是怎么回事?(Resolving: framework:jasmine)' 不见了?
当我在 webstrom IDE 中发出咕噜声时,我又得到了:
When I do grunt in the webstrom IDE I get again:
警告:framework:jasmine"没有提供者!(解决:framework:jasmine)使用 --force 继续.
Warning: No provider for "framework:jasmine"! (Resolving: framework:jasmine) Use --force to continue.
所以这个问题没有解决.
So this problem is not solved.
推荐答案
Grunt --force 有效,因为你告诉它绕过业力测试.请注意,如果您运行 grunt --force,它仍会显示完成,但有警告".
Grunt --force works because you tell it to bypass the karma tests. Notice if you run grunt --force, it'll still say "Done, but with warnings".
修复:将karma-jasmine"和karma-chrome-launcher"(或您使用的任何启动器)添加到 packages.json 中的 devDependencies 并再次运行 npm install.
To fix: add "karma-jasmine" and "karma-chrome-launcher" (or whatever launcher you use) to the devDependencies in packages.json and run npm install again.
npm install karma-jasmine --save-dev
npm install karma-chrome-launcher --save-dev
这会将 karma-jasmine 和 karma-chrome-launcher 保存在项目的 package.json 文件中.然后可以通过运行来安装软件包:
This will save karma-jasmine and karma-chrome-launcher in your project's package.json file. The packages can then be installed by running:
npm install
来源:没有framework:jasmine"的提供者!(解析:framework:jasmine)
这篇关于错误:没有“framework:jasmine"的提供者!(解决:框架:茉莉)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!