0

按照教程,我想使用 karma 进行测试。当我安装 karma 和 gulp-karma 时,我收到以下错误消息。它说没有安装 gulp-karma 所需的 karma@1.3.0。当我安装业力时,它也是这样说的。

现在,我无法确定它是否安装正确。

我试过删除node_modules目录,清除chache,升级npm并从头开始,结果是一样的。

npm 版本:3.10.8

包.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 可选跳过可选依赖:fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):npm WARN notsup 跳过可选依赖:fsevents@1.0.14 不支持的平台:想要 {"os":"darwin"," arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN gulp-karma@0.0.5 需要一个 karma@>=0.10 <=0.13 但是没有安装。npm WARN ui.spa@1.0.0 没有存储库字段。npm 错误!代码 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 可选跳过可选依赖:fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):npm WARN notsup 跳过可选依赖:fsevents@1.0.14 不支持的平台:想要 {"os":"darwin"," arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN gulp-karma@0.0.5 需要一个 karma@>=0.10 <=0.13 但是没有安装。npm WARN ui.spa@1.0.0 没有存储库字段。

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

4

1 回答 1

1

问题的根源在于 gulp-karma 包现在已被弃用

于 2016-09-25T20:46:19.763 回答