如何在react-native中使用i18 n-iso-countries?

5us2dqdw  于 2022-12-14  发布在  React
关注(0)|答案(1)|浏览(122)

我需要获得不同语言的国家名称(使用本地化)我找到了这个库i18 n-iso-countries:https://www.npmjs.com/package/i18n-iso-countries做我需要的,但当我试图安装它使用npm安装i18 n-iso-countries我得到这些错误:

`npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: qoyod_mobile@1.5.4 npm ERR! Found: react-native@0.70.3 npm ERR! node_modules/react-native npm ERR!   peer react-native@"*" from @intercom/intercom-react-native@3.0.5 npm ERR!   node_modules/@intercom/intercom-react-native npm ERR!     @intercom/intercom-react-native@"^3.0.5" from the root project npm ERR!   peer react-native@"^0.0.0-0 || 0.60 - 0.70 || 1000.0.0" from @react-native-async-storage/async-storage@1.17.10 npm ERR!   node_modules/@react-native-async-storage/async-storage npm ERR!     @react-native-async-storage/async-storage@"^1.17.10" from the root project npm ERR!   36 more (@react-native-community/masked-view, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! dev react-native@"0.70.5" from the root project npm ERR! npm ERR! Conflicting peer dependency: react@18.1.0 npm ERR! node_modules/react npm ERR!   peer react@"18.1.0" from react-native@0.70.5 npm ERR!   node_modules/react-native npm ERR!     dev react-native@"0.70.5" 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\username\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\username\AppData\Local\npm-cache\_logs\2022-12-04T13_04_11_830Z-debug-0.log`

我如何在react-native中使用这个库,或者react-native中是否有其他库可以给予不同语言的国家?

相关问题