【问题标题】:Error in npm install commandnpm install 命令出错
【发布时间】:2015-03-23 15:32:10
【问题描述】:

npm install 命令结束时出错。

angular#1.2.1 bower_components\angular
npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings'
peerDependencies requirements!
npm ERR! peerinvalid Peer karma@0.10.10 wants karma-requirejs@~0.2.0

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd F:\AngularExamples\KarmaTest546\AngularJS-Testing-Article
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9

npm ERR! code EPEERINVALID

npm ERR!

npm ERR! Additional logging details can be found in:

npm ERR!     F:\AngularExamples\KarmaTest546\AngularJS-Testing-Article\npm-debug
.log

npm ERR! not ok code 0

虽然我允许使用git config --global url."https://".insteadOf git:// 在http 而不是git 下克隆git

package.json :-

{


"name": "yom-angularjs-testing-article",



"version": "0.0.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/matsko/YOM-AngularJS-Testing-Article"
  },



"scripts": {
    "postinstall": "./node_modules/.bin/bower install"
  },
  "homepage": "https://github.com/yearofmoo/YOM-AngularJS-Testing-Article",
  "devDependencies": {


 "grunt": "~0.4.1",
    "grunt-css": "~0.5.4",
    "grunt-contrib-connect": "~0.1.2",
    "grunt-contrib-uglify": "~0.2.1",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-watch": "~0.4.4",
    "grunt-shell": "~0.2.2",
    "grunt-contrib-copy": "~0.4.1",
    "karma-mocha": "latest",
    "karma-chrome-launcher": "~0.1.0",
    "karma-safari-launcher": "latest",
    "karma-firefox-launcher": "~0.1.0",
    "karma-ng-scenario": "latest",
    "chai": "1.4.0",
    "karma-script-launcher": "~0.1.0",
    "karma-html2js-preprocessor": "~0.1.0",
    "karma-jasmine": "~0.1.3",
    "karma-requirejs": "~0.1.0",
    "karma-coffee-preprocessor": "~0.1.0",
    "karma-phantomjs-launcher": "~0.1.0",
    "karma": "~0.10.2",
    "grunt-karma": "~0.6.2",
    "grunt-open": "~0.2.2",
    "ng-midway-tester": "2.0.5",
    "bower": "~1.2.7"

  }
}

有人可以为此提出解决方案吗?

【问题讨论】:

  • packages.json 是什么样子的
  • 请查找包含 package.json 文件内容的更新帖子
  • 好吧,karma 0.10 需要 karma-requirejs 0.2,你指定了 0.1。如果可以的话,也许可以调整它以满足要求
  • 谢谢,成功了!非常感谢您的即时回复。

标签: node.js git angularjs npm karma-runner


【解决方案1】:

嗯,karma 0.10 需要 karma-requirejs 0.2,如您所见:

npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings' peerDependencies requirements! 

npm ERR! peerinvalid Peer karma@0.10.10 wants karma-requirejs@~0.2.0

但是,在您的 package.json 中,您指定了 karma-requirejs 0.1。

调整它以满足要求,它应该可以工作

【讨论】:

  • 您输入的实际命令是什么来调整npm 以满足这种要求?我在EPEERINVALID react-dom@0.14.7 requires a peer of react@^0.14.7 but none was installed. 上遇到了类似的错误,但已经完成了npm i -g react@^0.14.7。
【解决方案2】:

升级业力版本..就是这样.. "karma": "~0.12.0"

【讨论】:

    猜你喜欢
    • 2020-11-27
    • 2017-06-17
    • 2020-01-15
    • 2022-01-05
    • 2015-01-15
    • 2013-10-12
    • 2016-02-08
    • 2018-02-08
    • 2019-06-20
    相关资源
    最近更新 更多