尝试安装 @testing-library/react-native 时出错

时间:2021-06-30 23:51:10

标签: react-native npm npm-install react-native-testing-library

我在运行 npm install --save-dev @testing-library/react-native 时不断收到错误消息。如何安装@testing-library/react-native?我检查了我的 node-modules 文件夹,我已经安装了 @testing-library/react。这是我得到的错误:

isaac@Isaacs-MacBook-Pro frontend-app % npm install --save-dev @testing-library/react-native

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   react@"^16.14.0" from the root project
npm ERR!   peer react@">=16.0.0" from @testing-library/react-native@7.2.0
npm ERR!   node_modules/@testing-library/react-native
npm ERR!     dev @testing-library/react-native@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.13.1" from react-native@0.63.2
npm ERR! node_modules/react-native
npm ERR!   react-native@"https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz" from the root project
npm ERR!   peer react-native@">=0.59" from @testing-library/react-native@7.2.0
npm ERR!   node_modules/@testing-library/react-native
npm ERR!     dev @testing-library/react-native@"*" 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 /Users/isaac/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/isaac/.npm/_logs/2021-06-30T23_46_35_023Z-debug.log
isaac@Isaacs-MacBook-Pro frontend-app % 

0 个答案:

没有答案
相关问题