git npm install 命令出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23542320/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:01:32  来源:igfitidea点击:

Error in npm install command

node.jsgitangularjsnpmkarma-runner

提问by helloworld

Got an error at the end of npm installcommand.

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 [email protected] 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

although I have allowed to clone git under httpinstead of gitusing git config --global url."https://".insteadOf git://

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

package.json :-

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"

  }
}

can some one suggest a solution for this?

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

采纳答案by Tim

Well, karma 0.10requires karma-requirejs 0.2as you can see:

好吧,如您所见,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 [email protected] wants karma-requirejs@~0.2.0

However in your package.json you specified karma-requirejs0.1.

但是在您的 package.json 中您指定了karma-requirejs0.1.

Adjust that to meet the requirement and it should work

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

回答by Aneer Dev

upgrade karma version .. that's it .. "karma": "~0.12.0"

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