我想将reactstrap和bootstrap添加到ReactWebCoding中



我想将reactstrap和bootstrap添加到React Web编码中。在一个新的终端窗口中,我键入了npm install reactstrapnpm install bootstrap我得到这个错误:

C:reactcourseintro>npm install reactstrap
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependenc
npm ERR! 
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peer react@"*" from @testing-libra
npm ERR!   node_modules/@testing-library/reac
npm ERR!     @testing-library/react@"^11.2.2"
npm ERR!   peer react@"17.0.1" from react-dom
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@"*" from @testing
npm ERR!     node_modules/@testing-library/re
npm ERR!       @testing-library/react@"^11.2.
npm ERR!     react-dom@"^17.0.1" from the roo
npm ERR!     1 more (reactstrap)
npm ERR!   2 more (the root project, reactstr
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"0.14.x || ^15.0.0 || ^16
npm ERR! node_modules/reactstrap/node_modules
npm ERR!   react-popper@"^1.3.6" from reactst
npm ERR!   node_modules/reactstrap
npm ERR!     reactstrap@"*" from the root pro
npm ERR! 
npm ERR! Fix the upstream dependency conflict
npm ERR! this command with --force, or --lega
npm ERR! to accept an incorrect (and potentia
npm ERR!
npm ERR! See C:UsersemrecAppDataLocalnpm
npm ERR! A complete log of this run can be fo
npm ERR!     C:UsersemrecAppDataLocalnpm

这是由于reactstrap使用了与您使用的react版本(@^17.0.1(不兼容的react-popper的v1。

您应该考虑使用react的次要版本,或者正如我建议您的那样,考虑使用另一个UI组件库,如material或另一个更"高级"的UI组件库;实际的";UI库。

最新更新