微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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依赖项并在其示例应用程序中使用.

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐