program story

"framework : jasmine"에 대한 공급자가 없습니다!

inputbox 2020. 8. 21. 07:42
반응형

"framework : jasmine"에 대한 공급자가 없습니다! (해결 : framework : jasmine)


명령을 실행하면 grunt다음 경고가 표시됩니다.

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

아무도이 문제를 해결하는 방법을 알고 있습니까?


여만 각도 생성기 (요 각도)라는 새 프로젝트를 만든 후에도 동일한 오류가 발생했습니다.

나를위한 해결책은 packages.json의 devDependencies에 "karma-jasmine"을 추가하고 "npm install"을 다시 실행하는 것이 었습니다.

npm install karma-jasmine --save-dev

"프레임 워크 : 자스민"에 대한 공급자가 없습니다! "라는 오류 메시지가 해결되었습니다.

런처가 설치되지 않았다는 메시지를 받았기 때문에 devDependencies에 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-safari-launcher를 사용하기 위해 karma.conf en karma-e2e.conf에서 다음 줄을 변경했습니다.

browsers: ['Safari'],

I hope this will work for you, too.


As @Taco said, the default solution for this problem is installing the appropriate plugin, like this: npm install karma-jasmine --save-dev or this: npm install karma-mocha --save-dev.

However, this error is also expected when you are running an old version of karma-cli because they updated the way karma loads the plugins. To make sure you have the latest version, run this:

npm install -g karma-cli

My problem was in my karma.config.js file:

plugins: [require("karma-webpack")]

This caused the other karma-* plugins not to be loaded, which includes karma-jasmine.


If your karma.conf.js specifies a plugins attribute, be sure to add karma-jasmine to the list. If all the plugins are prefixed with karma-, you don't need to specify this attribute as the plugins will be automatically loaded.


It happened to me because I had Karma installed globally, and when I ran karma start command it actually ran in /usr/... rather than my dev directory.

In my case the solution was to remove karma and install karma-cli instead.

npm remove -g karma
npm install -g karma-cli

My problem was the selected "Karma package" in the IntelliJ run configuration. I did not select the project's karma package in the project's "node_module" folder: enter image description here

참고URL : https://stackoverflow.com/questions/22367059/no-provider-for-frameworkjasmine-resolving-frameworkjasmine

반응형