Node peerDependencies Errors With Grunt
I'm having problems using grunt on a new project that I was asked to work on. When I run:
npm install
in my project directory I get a bunch of peerinvalid errors, like this:
npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-contrib-clean@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-concat@0.4.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-jasmine@0.6.5 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-jshint@0.10.0 wants grunt@~0.4.0
etc..
When I run:
grunt --version
I get:
grunt-cli v0.1.13
grunt v0.4.4
I've been googling and messing around for a long time with no luck. Maybe I'm misunderstanding what grunt@~0.4.0 means?
Your package.json
may contain a dependency to a fixed version of grunt. Try to define:
"devDependencies": {
"grunt": "^0.4.0",
}
or with an old version of npm:
"devDependencies": {
"grunt": "~0.4.0",
}
(see What's the difference between tilde(~) and caret(^) in package.json? for an explanation of differences between ~
and ^
)
peerDependencies
is used by grunt plugins to specify which version of grunt they needs. ~0.4.0
means about the version 0.4
and is equivalent to 0.4.x