【发布时间】:2022-01-12 16:28:02
【问题描述】:
我在 React Js 中做过很多次,但这是我第一次在 React Native 中使用 axios。当我通过npm install axios 安装 axios 时,它会给出与其他库相关的巨大日志错误。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-location-view@0.3.0
npm ERR! Found: react-native-vector-icons@8.1.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons@">7.0.0" from react-native-elements@3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements@"^3.4.2" from the root project
npm ERR! peer react-native-vector-icons@"*" from react-native-paper@4.9.2
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper@"^4.9.2" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-vector-icons@"^4.4.3" from react-native-location-view@0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view@"^0.3.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-vector-icons@4.6.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons@"^4.4.3" from react-native-location-view@0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view@"^0.3.0" 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 C:\Users\Suyash\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Suyash\AppData\Local\npm-cache\_logs\2021-12-07T15_22_51_263Z-debug.log
它应该与 React JS 相同,但由于某种原因出现了这些错误。
【问题讨论】:
-
虽然应用程序与所有这些库都可以正常工作。
标签: reactjs react-native api npm axios