找不到插件"karma-ng-scenerio"; [英] Cannot find plugin "karma-ng-scenerio"

查看:38
本文介绍了找不到插件"karma-ng-scenerio";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在跟随Jack Herrington的视频教程"Learning AngularJS",该视频教程是我从packtpub.com购买的.

I am following along in a video tutorial "Learning AngularJS" by Jack Herrington that I purchased from packtpub.com.

在我用angular运行了第一次单元测试之后,我试图演示端到端测试.

I'm trying to demonstrate end-to-end testing after having run my first unit test with angular.

按照说明,我在karma-e2e.conf.js中添加了以下内容:

As per the instructions, I have added the following to the karma-e2e.conf.js:

    plugins: [
  'karma-chrome-launcher',
  'karma-ng-scenerio'
],

当我输入grunt test:e2e时,我得到以下信息:

When I type grunt test:e2e I get the following:

Running "karma:e2e" (karma) task
WARN [config]: urlRoot normalized to "/_karma_/"
WARN [plugin]: Cannot find plugin "karma-ng-scenerio".
Did you forget to install it ?
npm install karma-ng-scenerio --save-dev
Warning: No provider for "framework:ng-scenario"! (Resolving: framework:ng-cenario) Use --force to continue.

Aborted due to warnings.

好的,没问题:我键入

npm install karma-ng-scenerio --save-dev

现在我明白了:

npm ERR! 404 404 Not Found: karma-ng-scenerio
npm ERR! 404
npm ERR! 404 'karma-ng-scenerio' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'testdemo'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

所以我下载了karma-ng-scenario的zip并发出了此命令,看来问题已解决!

So I download the zip for karma-ng-scenario and issue this command and it looks like the problem is fixed!

npm install karma-ng-scenario-master\karma-ng-scenario-master --save-dev
karma-ng-scenario@0.1.0 node_modules\karma-ng-scenario

但是现在我再次键入命令并得到相同的结果

But now I type the command again and the same results

grunt test:e2e

我得到相同的结果!

Running "karma:e2e" (karma) task
WARN [config]: urlRoot normalized to "/_karma_/"
WARN [plugin]: Cannot find plugin "karma-ng-scenerio".
Did you forget to install it ?
npm install karma-ng-scenerio --save-dev
Warning: No provider for "framework:ng-scenario"! (Resolving: framework:ng-scenario) Use --force to continue.

我在做什么错了?

我进行了一些搜索,发现ng-scenerio已被弃用,但仍然可以使用...

I did some searching and found that ng-scenerio has been deprecated but should still work...

当我查看以下示例时 http://angular.github.io/protractor/#/似乎没有使用nodejs或grunt,如果确实应该使用量角器代替ng-scenerio,我会感到困惑.

When I looked at the example at http://angular.github.io/protractor/#/ it did not appear to using nodejs or grunt and I found this confusing if indeed protractor is supposed to be a substitute for ng-scenerio.

推荐答案

就像一个简单的错字:您有 karma-ng-scenerio (请注意,scen e rio而不是 karma-e2e.conf 中的scen a rio).这也是您首次安装尝试失败的原因.解决这个问题,我相信与此有关的所有事情都应该起作用.

Looks like a simple typo: you have karma-ng-scenerio (note, scenerio instead of scenario) in your karma-e2e.conf. That is also why your first installation attempts failed. Fix that, and I believe everything regarding this should work.

这篇关于找不到插件"karma-ng-scenerio";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆