5

I had an error after installed "react-bootstrap-table".

├── react@15.4.1 
└── UNMET PEER DEPENDENCY react-router@3.0.0

My package.json

"dependencies": {
    "isomorphic-fetch": "^2.2.1",
    "react": "^15.4.0",
    "react-addons-linked-state-mixin": "^15.4.0",
    "react-bootstrap": "^0.30.6",
    "react-bootstrap-table": "^2.6.0",
    "react-cookie": "^0.4.8",
    "react-dom": "^15.4.0",
    "react-redux": "^4.4.6",
    "react-router": "^3.0.0",
    "react-router-apply-middleware": "0.0.2",
    "react-router-bootstrap": "^0.23.1",
    "react-router-relative-links": "^0.1.0",
    "redux": "^3.6.0",
    "redux-logger": "^2.7.4",
    "redux-promise-middleware": "^4.1.0",
    "redux-thunk": "^2.1.0"
  }

Thanks any help.

Vien Nguyen
  • 385
  • 1
  • 2
  • 17
  • Unmet peer dependencies are libraries that the library depends on, but that are not installed by default. It's just telling you you need react-router in order to use this library. It doesn't check whether you already have it or not. – Alexander Dec 07 '16 at 10:24
  • Thanks for your help. I had understood. Can you explain more about it. My project still work fine. Maybe it didn't affect to my project. Thanks. – Vien Nguyen Dec 07 '16 at 16:48
  • http://stackoverflow.com/questions/20764881/why-does-npm-install-say-i-have-unmet-dependencies This has some solutions. – Alexander Dec 08 '16 at 07:49
  • Thanks for your answer. It is very helpful. :). I understood it. – Vien Nguyen Dec 08 '16 at 17:01
  • Possible duplicate of [Unable to Install React-Intl using NPM](http://stackoverflow.com/questions/38697658/unable-to-install-react-intl-using-npm) – Paul Sweatte Jan 19 '17 at 17:05
  • ok thank for your help! – Vien Nguyen Jan 21 '17 at 01:24

1 Answers1

0

This blog post explains Peer Dependancies well!
https://nodejs.org/en/blog/npm/peer-dependencies/

There's one use case where this falls down, however: plugins. A plugin package is meant to be used with another "host" package, even though it does not always directly use the host package. Most plugins never actually depend on their host package.

The solution to this was peer dependancy

In your case it seems that you don't actually need to install it since I dug through the react-bootstrap-table package's repo and found that react-router@3.0.0 is mentioned as a dev dependency and used in their example app.

So unless they bundle the example along with the package which is highly unlikely, you can ignore it.

Aftab Khan
  • 3,853
  • 1
  • 21
  • 30