unit-testingkarma-runnergulp-karma

Why do I get UNMET PEER DEPENDENCY when I install karma and gulp-karma?


Following this tutorial I would like to use karma for testing. When I install karma and gulp-karma I get the error message below. It says karma@1.3.0 is not installed which is needed for gulp-karma. When I install karma it says the same.

Now, I can't decide whether it is installed correctly or not.

I have tried to remove node_modules directory, clearing chache, upgrading npm and start it from scratch, the result is the same.

npm version: 3.10.8

package.json:

{
  "name": "ui.spa",
  "version": "1.0.0",
  "description": "Framework module for Digital Library",
  "main": "Gulpfile.js",
  "dependencies": {
    "bower": "^1.7.9",
    "gulp": "^3.9.1",
    "gulp-clean": "^0.3.2",
    "gulp-inject": "^4.1.0",
    "gulp-karma": "0.0.5",
    "gulp-typescript": "^2.14.1",
    "gulp-util": "^3.0.7",
    "jasmine": "^2.5.2",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "^1.0.2",
    "karma-phantomjs-launcher": "^1.0.2",
    "merge-stream": "^1.0.0",
    "phantomjs": "^2.1.7",
    "require-dir": "^0.3.0",
    "run-sequence": "^1.2.2",
    "stream-series": "^0.1.1",
    "typings": "^1.4.0"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>npm install karma --save ui.spa@1.0.0 C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa `-- UNMET PEER DEPENDENCY karma@1.3.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN gulp-karma@0.0.5 requires a peer of karma@>=0.10 <=0.13 but none was installed. npm WARN ui.spa@1.0.0 No repository field. npm ERR! code 1

C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>npm install gulp-karma --save ui.spa@1.0.0 C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa +-- gulp-karma@0.0.5 `-- UNMET PEER DEPENDENCY karma@1.3.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN gulp-karma@0.0.5 requires a peer of karma@>=0.10 <=0.13 but none was installed. npm WARN ui.spa@1.0.0 No repository field.

C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>


Solution

  • The root of the problem is that gulp-karma package is deprecated now.