gpt4 book ai didi

gruntjs - 没有 "framework:jasmine"的提供者! (解析: framework:jasmine)

转载 作者:行者123 更新时间:2023-12-02 09:31:16 24 4
gpt4 key购买 nike

当我运行命令 grunt 时,我收到以下警告:

Running "karma:unit" (karma) task
Warning: No provider for "framework:jasmine"! (Resolving: framework:jasmine) Use --force to continue.

有人知道如何解决这个问题吗?

最佳答案

创建新项目 yeoman 角度生成器(yo 角度)后,我遇到了同样的错误。

我的解决方案是将“karma-jasmine”添加到packages.json中的devDependency中,然后再次运行“npm install”。

npm install karma-jasmine --save-dev

这解决了错误消息“没有“framework:jasmine”的提供程序!”

我还必须向 devDependency 添加 karma 浏览器启动器,因为我收到消息称未安装启动器(请参阅 http://karma-runner.github.io/0.10/config/browsers.html )。

npm install karma-safari-launcher --save-dev

我的packages.json在我的操作后看起来像这样:

{
"name": "test1",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-bower-install": "~0.7.0",
"grunt-concurrent": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.3.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-google-cdn": "~0.2.0",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.2.0",
"grunt-usemin": "~2.0.0",
"jshint-stylish": "~0.1.3",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.1",
"karma-ng-scenario": "^0.1.0",
"grunt-karma": "^0.8.0",
"karma": "^0.12.0",
"karma-jasmine": "~0.2.2",
"karma-safari-launcher": "~0.1.1",
"karma-ng-html2js-preprocessor": "^0.1.0"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}

我在 karma.conf 和 karma-e2e.conf 中更改了以下行以使用 karma-safari-launcher:

browsers: ['Safari'],

我希望这对您也有用。

关于gruntjs - 没有 "framework:jasmine"的提供者! (解析: framework:jasmine),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22367059/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com