reactjs – UNMET PEER DEPENDENCY react-router@3.0.0

安装“react-bootstrap-table”后出错.

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

我的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"
  }

谢谢你的帮助.

解决方法

这篇博文很好地解释了Peer Dependancies!
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

在你的情况下,似乎你实际上并不需要安装它,因为我挖掘了react-bootstrap-table软件包的repo,并发现react-router@3.0.0被提及为dev依赖项并在其示例应用程序中使用.

因此,除非他们将示例与包非常不可能捆绑在一起,否则您可以忽略它.

相关文章

一、前言 在组件方面react和Vue一样的,核心思想玩的就是组件...
前言: 前段时间学习完react后,刚好就接到公司一个react项目...
前言: 最近收到组长通知我们项目组后面新开的项目准备统一技...
react 中的高阶组件主要是对于 hooks 之前的类组件来说的,如...
我们上一节了解了组件的更新机制,但是只是停留在表层上,例...
我们上一节了解了 react 的虚拟 dom 的格式,如何把虚拟 dom...