Ralph D
Ralph D

Reputation: 103

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 [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.0
npm ERR! peerinvalid Peer [email protected] 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?

Upvotes: 0

Views: 1054

Answers (1)

krampstudio
krampstudio

Reputation: 3611

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

Upvotes: 2

Related Questions