npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b6c4d3d7d5c2f6878198869887" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/react
npm ERR! peer react@">=16.0" from @react-native-community/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99f4f8eaf2fcfdb4eff0fceed9a9b7a8b7a8a8" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/@react-native-community/masked-view
npm ERR! peer @react-native-community/masked-view@">= 0.1.0" from @react-navigation/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="592a2d383a32196c77686d776c" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/@react-navigation/stack
npm ERR! @react-navigation/stack@"^5.14.5" from the root project
npm ERR! @react-native-community/masked-view@"^0.1.11" from the root project
npm ERR! peer react@"*" from @react-navigation/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e1838e95958e8ccc95808392a1d4cfd0d0cfd0d0" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/@react-navigation/bottom-tabs
npm ERR! @react-navigation/bottom-tabs@"^5.11.11" from the root project
npm ERR! 15 more (@react-navigation/core, @react-navigation/native, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0" from @callstack/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4735222624336a332f222a226a373528312e232235077469776971" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/react-native-paper/node_modules/@callstack/react-theme-provider
npm ERR! @callstack/react-theme-provider@"^3.0.6" from <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9be9fefaf8efb6f5faeff2edfeb6ebfaebfee9dbafb5a2b5aa" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper@"*" 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! A complete log of this run can be found in:
最佳答案
将 --force
与 npm install
命令结合使用。
npm install <package-name> --force
您尝试安装的软件包依赖于 React v16,但您有 React v17。
这个错误是在最新的npm版本中遇到的。
关于reactjs - npm install react-native-paper 期间出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67946298/