最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - The package grunt does not satisfy its siblings' peerDependencies requirements - Stack Overflow

programmeradmin6浏览0评论

I am trying to create my grunt build but stuck in following error

npm WARN package.json Dependency 'grunt' exists in both dependencies and devDependencies, using 'grunt@~0.4.2' from dependencies
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.1
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.1
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.5
npm ERR! peerinvalid Peer [email protected] wants grunt@>=0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4

As here mentioned, I uninstalled my node,npm and grunt and reinstalled them but still facing same issue ?

Any idea ?

My JSON dependencies are :

"dependencies": {
    "grunt": "~0.4.2",
    "grunt-contrib-requirejs": "~0.4.1",
    "grunt-config": "~0.1.4",
    "grunt-string-replace": "~0.2.7",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-cssmin": "~0.10.0"
  },
  "devDependencies": {
    "grunt": "0.4.2",
    "grunt-cli": "0.1.13",
    "grunt-contrib-jshint": ">0.8.0",
    "grunt-contrib-uglify": ">0.3.2",
    "load-grunt-tasks": ">=0.3.0",
    "requirejs": ">=2.1.10",
    "grunt-exec": "~0.4.5"
  }

Same thing is working fine for my colleague.

I am trying to create my grunt build but stuck in following error

npm WARN package.json Dependency 'grunt' exists in both dependencies and devDependencies, using 'grunt@~0.4.2' from dependencies
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.1
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.1
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4.5
npm ERR! peerinvalid Peer [email protected] wants grunt@>=0.4.0
npm ERR! peerinvalid Peer [email protected] wants grunt@~0.4

As here mentioned, I uninstalled my node,npm and grunt and reinstalled them but still facing same issue ?

Any idea ?

My JSON dependencies are :

"dependencies": {
    "grunt": "~0.4.2",
    "grunt-contrib-requirejs": "~0.4.1",
    "grunt-config": "~0.1.4",
    "grunt-string-replace": "~0.2.7",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-cssmin": "~0.10.0"
  },
  "devDependencies": {
    "grunt": "0.4.2",
    "grunt-cli": "0.1.13",
    "grunt-contrib-jshint": ">0.8.0",
    "grunt-contrib-uglify": ">0.3.2",
    "load-grunt-tasks": ">=0.3.0",
    "requirejs": ">=2.1.10",
    "grunt-exec": "~0.4.5"
  }

Same thing is working fine for my colleague.

Share Improve this question asked Feb 26, 2015 at 14:49 AnshulAnshul 9,48011 gold badges60 silver badges76 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

I had a similar error like this today, and fixed it by upgrading npm:

npm install -g npm

I had version 2.14 and after upgrading it became 3.8

You declared grunt dependency twice. One for development and one that is not. You also have a different version rule for both. This is what causes the conflict.

You should remove one of these. (usually grunt is part of devdependencies)

dependencies

"grunt": "~0.4.2",

devDependencies

"grunt": "0.4.2",

Edit:

I tested it, this solves the problem:

"dependencies": {
  "grunt-contrib-requirejs": "~0.4.1",
  "grunt-config": "~0.1.4",
  "grunt-string-replace": "~0.2.7",
  "grunt-contrib-clean": "~0.5.0",
  "grunt-contrib-cssmin": "~0.10.0"
},
"devDependencies": {
  "grunt": "~0.4.2",
  "grunt-cli": "0.1.13",
  "grunt-contrib-jshint": ">0.8.0",
  "grunt-contrib-uglify": ">0.3.2",
  "load-grunt-tasks": ">=0.3.0",
  "requirejs": ">=2.1.10",
  "grunt-exec": "~0.4.5"
}

Updating all my global npm packages fixed the issue for me:

npm update -g
发布评论

评论列表(0)

  1. 暂无评论