1

I need to get the country names in different languages ( using localization ) I found this library i18n-iso-countries : https://www.npmjs.com/package/i18n-iso-countries doing what I need , but when I tried to install it using npm install i18n-iso-countries I got these errors :

`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`

How can I use this library in react-native , or is there and alternative library in react native that can give me the countries in different languages ?

1 Answers1

0

From your error looks like you have a peer dependency conflict. This is an article on how to resolve it https://www.folkstalk.com/2022/09/fix-the-upstream-dependency-conflict-installing-npm-packages-with-code-examples.html

Kirill Novikov
  • 2,576
  • 4
  • 20
  • 33
  • [Your answer is in another castle](https://meta.stackexchange.com/q/225370/997587). Please summarize the relevant portions of the article. – starball Dec 06 '22 at 20:58