53

I've downloaded Bootstrap source files from the official website and I'm getting dependency conflicts when installing the project using node's npm. I have grunt 0.4.3 installed on my machine but some bootstrap dependencies require 0.4.0 and some 0.4.1.

The npm install -g grunt-cli command executed without any problems. Here's the log that I'm getting after executing npm install command:

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-banner@0.2.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-clean@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-concat@0.3.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-connect@0.6.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-copy@0.5.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-csslint@0.2.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-cssmin@0.7.0 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-jade@0.9.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-contrib-jshint@0.8.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-less@0.9.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-qunit@0.4.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-uglify@0.3.3 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-watch@0.5.3 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-csscomb@2.0.1 wants grunt@~0.4.2
npm ERR! peerinvalid Peer grunt-exec@0.4.3 wants grunt@~0.4
npm ERR! peerinvalid Peer grunt-html-validation@0.1.13 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-jekyll@0.4.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-jscs-checker@0.3.2 wants grunt@0.4.2
npm ERR! peerinvalid Peer grunt-saucelabs@5.0.1 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-sed@0.1.1 wants grunt@~0.4

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\\Desktop\bootstrap-3.1.1
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\\Desktop\bootstrap-3.1.1\npm-debug.log
npm ERR! not ok code 0

I'm following these installation steps.

How do I install this project cleanly, without any errors?

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
rpozarickij
  • 1,477
  • 3
  • 14
  • 27
  • 2
    Btw, gruntjs 0.4.3 was released only yesterday. – Pavel S. Mar 08 '14 at 13:14
  • 4
    This problem existed due to grunt-jscs-checker, which I'm the author. It was incorrectly requiring grunt to be strictly 0.4.2. As of now, bootstrap is using a newer version of grunt-jscs-checker, which fixed this problem. – gustavohenke Apr 28 '14 at 13:07

6 Answers6

65

I ran into this problem this morning too. I ended up changing line 30 in Bootstrap's package.json file: from "~0.4.2" to "0.4.2":

27  "devDependencies": {
...
30    "grunt" : "0.4.2"

This means that 0.4.3 no longer matches the dependency spec but it also means you won't install new versions of grunt later. It's enough to get things working but you should probably change it back eventually (maybe in your next bootstrap project leave it alone).

joeblubaugh
  • 1,127
  • 7
  • 10
12

I encountered the same problem. Performing the following:

bower install bootstrap
cd bower_components/bootstrap
npm install

Resulted in:

npm ERR! peerinvalid The package grunt does not satisfy 
   its siblings' peerDependencies requirements!

I resolved this by first uninstalling grunt from the bootstrap directory

npm uninstall grunt

Then I installed grunt 0.4.2

npm install grunt@0.4.2

This time, npm install worked just fine

npm install
RobV8R
  • 1,036
  • 8
  • 16
5

this problem is peerDependencies for grunt
If you want to know this issue, then go to this url
http://blog.nodejs.org/2013/02/07/peer-dependencies/

this is solution to solve it's problem
step1 : You open the package.json in root directory
step2 : find the string "grunt" : "~0.4.2"
step3 : Modify to "grunt": "0.4.2"
step4 : $ npm install

kazikai
  • 86
  • 2
0

You may have Grunt 0.4.3 installed globally but nothing installed locally.

  1. Run $ grunt --version to find which version you are on (not a necessary step).
  2. Create a package.json file in the root of the folder you mean to have your project on.

    {
        "name" : "MyProject",
        "version" : "0.1.0",
        "author" : "My name",
        "private" : true,
    
        "devDependencies" : {
            "grunt" : "~0.4.2"
        }
    }
    
  3. Run $ npm install while at the project's root folder.

Done!

--- UPDATE ---

You could use Bower to install Bootstrap for you. It makes cumbersome installations a breeze. Bootstrap's Getting Started guide advises using it!

$ bower install bootstrap

Here is a blog post that might be relevant to you: Using Grunt + Bower with Laravel and Bootstrap

Or you could always opt to let Grunt manage the installation of Bootstrap and maintain it as a dependency... There are several plugins out there that do the heavy-lifting.

Wallace Sidhrée
  • 11,221
  • 6
  • 47
  • 58
  • 1. This outputs `grunt-cli v0.1.13` 2 - 3. This also works . It still doesn't help to install the Bootstrap project. I also tried installing `grunt@0.4.1` globally and then changing Bootstrap's grunt dependency to version `0.4.1` instead of `~0.4.2`, but the log is still the same. – rpozarickij Mar 08 '14 at 14:40
  • @cNduo forget your Bootstrap project for a moment, let's debug `Grunt`. On Terminal, `cd` your way to an empty folder of your choice, even better if it's under your user. While there, create a `package.json` file and paste what I've posted on my answer. Once you've done that, run `$ npm install` on the same folder. `Grunt` should be then installed as a dependency to that folder. `~0.4.2` means "install latest version available, but minimum required version is 0.4.2". – Wallace Sidhrée Mar 08 '14 at 15:00
  • Thanks for quick response. All of the above steps work fine, but what it have to do with the dependencies issues in Bootstrap? – rpozarickij Mar 08 '14 at 15:06
  • But that's good, then we know the problem *is* with Bootstrap. I've had problems with 3rd party libraries that required newer / older version of `node` to run properly. When you run `$ node -v`, what do you get? – Wallace Sidhrée Mar 08 '14 at 15:11
  • [My reply](http://stackoverflow.com/questions/10972176/find-the-version-of-an-installed-npm-package/18226166#18226166) to [this question](http://stackoverflow.com/questions/10972176/find-the-version-of-an-installed-npm-package/) might shed some light into what I meant in my last comment. – Wallace Sidhrée Mar 08 '14 at 15:19
  • At the moment of posting the question it was `v0.10.15`, now I have `v0.10.26`, but still no success. – rpozarickij Mar 08 '14 at 15:29
  • `v0.10.26` is the latest. You might want to try the version before the last, using [**nvm**](https://github.com/creationix/nvm). Once I had a big headache making [Compass](http://compass-style.org/) work, changing to the `node` version before the latest solved the issue. You might need to keep trying with different versions... What about trying to install previous versions of Bootstrap? Latest versions can be a bit too bleeding-edge sometimes. – Wallace Sidhrée Mar 08 '14 at 17:53
  • Thanks for your suggestions, but I ended up going with grunt@0.4.2, which blended smoothly into the project. – rpozarickij Mar 08 '14 at 20:06
  • Never mind about that, I should have seen that coming. But now you know: better not to fiddle with too fresh latest versions of anything, they're too bleeding edge. :) – Wallace Sidhrée Mar 08 '14 at 20:50
0

I had this problem too.

I installed bootstrap using git clone https://github.com/twbs/bootstrap.git and it worked fine from that resulting bootstrap directory.

jaydisc
  • 369
  • 2
  • 11
0

Try npm cache clean and then try install command again.

Shoaib Iqbal
  • 1,208
  • 11
  • 21