我无法解决的一些依赖项问题

pat*_*ash 2 macos npm reactjs react-native

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @react-native-community/async-storage@1.12.1
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@">=16.3.0" from @callstack/react-theme-provider@3.0.7
npm ERR!   node_modules/@callstack/react-theme-provider
npm ERR!     @callstack/react-theme-provider@"^3.0.7" from react-native-paper@4.12.4
npm ERR!     node_modules/react-native-paper
npm ERR!       react-native-paper@"^4.12.4" from the root project
npm ERR!   25 more (@react-native-community/masked-view, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from @react-native-community/async-storage@1.12.1
npm ERR! node_modules/@react-native-community/async-storage
npm ERR!   @react-native-community/async-storage@"^1.12.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8" from @react-native-community/async-storage@1.12.1
npm ERR!   node_modules/@react-native-community/async-storage
npm ERR!     @react-native-community/async-storage@"^1.12.1" 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.
Run Code Online (Sandbox Code Playgroud)

小智 5

该包@react-native-community/async-storage被重命名为@react-native-async-storage/async-storage当它被删除到范围之外时@react-native-community

在您的package.json文件中,替换@react-native-community/async-storage为更新的@react-native-async-storage/async-storage包!