reactjs - npm install react-native-paper 期间出现问题

标签 reactjs react-native npm

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:

最佳答案

--forcenpm install 命令结合使用。

npm install <package-name> --force

您尝试安装的软件包依赖于 React v16,但您有 React v17。

这个错误是在最新的npm版本中遇到的。

关于reactjs - npm install react-native-paper 期间出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67946298/

相关文章:

javascript - 在内置 SPA 中禁用缓存

node.js - 命令gulp错误 "assert.js:42 throw new errors.AssertionError"

node.js - npm 安装卡在 loadIdealTree :loadAllDepsIntoIdealTree: sill install loadIdealTree 上

sockets - React + Sails + Socket.io

javascript - React.js 调用组件进入setState

javascript - 如何将现有的非 React-Native-Component JS 导入/需要到 React Native 组件

javascript - 为什么要执行前一个屏幕组件中的 socket.on() ?

reactjs - React Native - 找不到模块 X 或其相应的类型声明

node.js - 找不到用于 react-native 和 create-react-app 的命令 (Mac OS)

node.js - 带有 TypeScript 的 Nodejs 会出现奇怪的错误