Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

while trying to install react-bootstrap-table i am getting an error like this

PS C:\Users\ravur\demo-web-page> npm install react-bootstrap-table npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"^17.0.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^15.0.0 || ^16.0.0" from [email protected] npm ERR! node_modules/react-bootstrap-table npm ERR! react-bootstrap-table@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\ravur\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\ravur\AppData\Local\npm-cache_logs\2021-04-27T07_14_51_100Z-debug.log

like image 625
venugopal reddy Avatar asked Feb 01 '26 19:02

venugopal reddy


1 Answers

That is caused by the React version you are using react@"^17.0.2", while the react-bootstrap-table library is based upon react@"^15.0.0 || ^16.0.0".

Since the difference in version is a major release, you could incur in problems hard to debug, since react could have implemented changes that could have broken the library functionality e.a. reason why npm throws you that error.

At this point, you could either set your project to use react 16 instead of 17 to make sure nothing breaks or you could otherwise keep your version as is and force the library installation as such: npm i react-bootstrap-table --legacy-peer-deps.

If you opt for the second alternative, you know you won't need to use --legacy-peer-deps for new installations as soon as the library maintainers will update the library to work off v.17.

like image 177
ale917k Avatar answered Feb 03 '26 09:02

ale917k