npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: chartsdemo@0.0.1
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0" from react-native-webview@6.11.1
npm ERR! node_modules/react-native-webview
npm ERR! peer react-native-webview@"^6.9.0" from react-native-echarts-pro@1.8.9
npm ERR! node_modules/react-native-echarts-pro
npm ERR! react-native-echarts-pro@"*" 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!
npm ERR! For a full report see:
npm ERR! /Users/liwei/.npm/_logs/2023-02-22T08_25_14_195Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/liwei/.npm/_logs/2023-02-22T08_25_14_195Z-debug-0.log
系统/版本/依赖信息npx react-native info如下:
info Fetching system and libraries information...
System:
OS: macOS 12.5
CPU: (8) arm64 Apple M2
Memory: 257.77 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.6.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.4.0 - /opt/homebrew/bin/npm
Watchman: 2023.02.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.1 => 0.71.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
创建一个新项目:
npx react-native init chartsdemo --version 0.71.1
安装
react-native-echarts-pro
报错如下:npx react-native info
如下: