I am getting these errors while installing react-native-linear-gradient, even for uninstalling and updating I am getting the same errors.
PS C:\Users\sawan\OneDrive\Desktop\WorkoutApp\workout> npm install react-native-linear-gradient npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: react-native-windows#0.71.0 npm ERR! Found: react#18.1.0 npm ERR! node_modules/react npm ERR! peer react#">=16.3.0" from #callstack/react-theme-provider#3.0.8 npm ERR! node_modules/#callstack/react-theme-provider npm ERR! #callstack/react-theme-provider#"^3.0.8" from react-native-paper#5.1.4 npm ERR! node_modules/react-native-paper npm ERR! peer react-native-paper#"*" from react-native-material-dropdown-v2-fixed#0.11.3 npm ERR! node_modules/react-native-material-dropdown-v2-fixed npm ERR! react-native-material-dropdown-v2-fixed#"^0.11.3" from the root project npm ERR! peer react#"*" from #react-navigation/bottom-tabs#6.5.2 npm ERR! node_modules/#react-navigation/bottom-tabs npm ERR! #react-navigation/bottom-tabs#"^6.5.2" from the root project npm ERR! 23 more (#react-navigation/core, #react-navigation/elements, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react#"18.2.0" from react-native-windows#0.71.0 npm ERR! node_modules/react-native-windows npm ERR! peer react-native-windows#">=0.63.3" from react-native-orientation-locker#1.5.0 npm ERR! node_modules/react-native-orientation-locker npm ERR! react-native-orientation-locker#"^1.5.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: react#18.2.0 npm ERR! node_modules/react npm ERR! peer react#"18.2.0" from react-native-windows#0.71.0 npm ERR! node_modules/react-native-windows npm ERR! peer react-native-windows#">=0.63.3" from react-native-orientation-locker#1.5.0 npm ERR! node_modules/react-native-orientation-locker npm ERR! react-native-orientation-locker#"^1.5.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\sawan\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\sawan\AppData\Local\npm-cache\_logs\2023-02-01T07_19_34_419Z-debug-0.log
Before this I tried running the project, then I started getting another error saying 'So and so module is not present within the project or in node_modules.
Here is the error:
error: Error: Unable to resolve module react-native-linear-gradient from C:\Users\sawan\OneDrive\Desktop\WorkoutApp\workout\src\screens\SignInScreen\SignInScreen.js: react-native-linear-gradient could not be found within the project or in these directories:
node_modules
7 | import CustomButton from '../../components/CustomButton';
8 | import {useNavigation} from '#react-navigation/native';
> 9 | import LinearGradient from 'react-native-linear-gradient';
| ^
10 |
11 | const API_URL = Platform.OS === 'android' ? 'http://localhost:3000' : 'http://192.168.2.143:3000';
12 |
I've tried using --force but after running it again it shows the same error. Do I have to reinstall all my packages again or do I have to change the react version?
Have you tried to stop the application and do the below process:
remove node_modules and package-lock.json
run npm i --legacy-peer-deps
rerun application
Related
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 ?
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
I am trying to install the react native deck swiper using npm and I am getting the following error. Guys is the something wrong with this library "npm install react-native-deck-swiper" and if there is how do we fix it?
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: react-native-deck-swiper#2.0.8
npm ERR! Found: react-native#0.69.5
npm ERR! node_modules/react-native
npm ERR! peer react-native#"" from #react-native-community/cli#8.0.6
npm ERR! node_modules/#react-native-community/cli
npm ERR! #react-native-community/cli#"^8.0.4" from react-native#0.69.5
npm ERR! peer react-native#"" from #react-navigation/elements#1.3.5
npm ERR! node_modules/#react-navigation/elements
npm ERR! #react-navigation/elements#"^1.3.5" from #react-navigation/native-stack#6.8.0
npm ERR! node_modules/#react-navigation/native-stack
npm ERR! #react-navigation/native-stack#"^6.8.0" from the root project
npm ERR! 6 more (#react-navigation/native, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native#"^0.49.1" from react-native-deck-swiper#2.0.8
npm ERR! node_modules/react-native-deck-swiper
npm ERR! react-native-deck-swiper#"^2.0.8" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native#0.49.5
npm ERR! node_modules/react-native
npm ERR! peer react-native#"^0.49.1" from react-native-deck-swiper#2.0.8
npm ERR! node_modules/react-native-deck-swiper
npm ERR! react-native-deck-swiper#"^2.0.8" 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\Leago\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\Leago\AppData\Local\npm-cache_logs\2022-08-31T23_17_27_722Z-debug-0.log
I had the same issue as you, I found out it's more related to the command npm, apparently it works with yarn.
You can check these two links in which the problem is treated, but I don't think forcing the installation with npm install --force is a good idea:
React-native-deck-swiper unable to install
https://github.com/alexbrillant/react-native-deck-swiper/issues/337
Right now my current project is using an old version of webpack (3.5.1) and I need to update it to a version that can understand object spread because an npm module would not compile because of older webpack version.
If I run npm update webpack I get the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: css-loader#1.0.1
npm ERR! Found: webpack#3.5.1
npm ERR! node_modules/webpack
npm ERR! webpack#"3.5.1" from the root project
npm ERR! peer webpack#"2 || 3" from babel-loader#7.1.1
npm ERR! node_modules/babel-loader
npm ERR! babel-loader#"7.1.1" from the root project
npm ERR! 10 more (extract-text-webpack-plugin, file-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^4.0.0" from css-loader#1.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"1.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^4.0.0" from css-loader#1.0.1
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"1.0.1" from the root project
I tried to force update but it didn't work either.
Fresh install expo init firstapp then next npm install native-base. I encounter error like this below. I tried deleting node_modules and tried also deleting expo cli I have no success.
Anyone encounter this?
PS E:\Projects\ReactNative\firstapp> npm install native-base
>>
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#16.13.1
npm ERR! node_modules/react
npm ERR! peer react#"^16.13.1" from react-dom#16.13.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">=16.5.1" from react-native-web#0.13.18
npm ERR! node_modules/react-native-web
npm ERR! react-native-web#"~0.13.12" from the root project
npm ERR! react-dom#"16.13.1" from the root project
npm ERR! peer react#"*" from react-native-safe-area-context#3.2.0
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context#"3.2.0" from expo#41.0.1
npm ERR! node_modules/expo
npm ERR! expo#"~41.0.1" from the root project
npm ERR! 5 more (react-native-web, use-subscription, the root project, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native-windows#0.64.8
npm ERR! node_modules/native-base/node_modules/react-native-windows
npm ERR! peer react-native-windows#">=0.62" from #react-native-community/datetimepicker#3.5.0
npm ERR! node_modules/native-base/node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"^3.0.2" from native-base#2.15.2
npm ERR! node_modules/native-base
npm ERR! native-base#"*" 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\XXX\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\XXX\AppData\Local\npm-cache\_logs\2021-05-23T08_04_02_291Z-debug.log
Looks like maybe the solution to your problem might be to use a compatible version of native base with your react native version see table in native base documentation on the Compatibility Versions section.
npm install native-base
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react#16.13.1
npm ERR! node_modules/react
npm ERR! peer react#"^16.13.1" from react-dom#16.13.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">=16.5.1" from react-native-web#0.13.18
npm ERR! node_modules/react-native-web
npm ERR! react-native-web#"~0.13.12" from the root project
npm ERR! react-dom#"16.13.1" from the root project
npm ERR! peer react#"16.13.1" from react-native#0.63.2
npm ERR! node_modules/react-native
npm ERR! peer react-native#">=0.62.0-rc.0 <0.64.0" from #react-native-community/cli#4.14.0
npm ERR! node_modules/#react-native-community/cli
npm ERR! #react-native-community/cli#"^4.14.0" from react-native#0.63.2
npm ERR! peer react-native#"*" from react-native-safe-area-context#3.2.0
npm ERR! node_modules/react-native-safe-area-context
npm ERR! react-native-safe-area-context#"3.2.0" from expo#41.0.1
npm ERR! node_modules/expo
npm ERR! expo#"~41.0.1" from the root project
npm ERR! 3 more (the root project, native-base, #codler/react-native-keyboard-aware-scroll-view)
npm ERR! 5 more (react-native-safe-area-context, react-native-web, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native-windows#0.64.4
npm ERR! node_modules/native-base/node_modules/react-native-windows
npm ERR! peer react-native-windows#">=0.62" from #react-native-community/datetimepicker#3.4.7
npm ERR! node_modules/native-base/node_modules/#react-native-community/datetimepicker
npm ERR! #react-native-community/datetimepicker#"^3.0.2" from native-base#2.15.2
npm ERR! node_modules/native-base
npm ERR! native-base#"*" 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 /Users/idanknafo/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/idanknafo/.npm/_logs/2021-04-26T15_35_25_621Z-debug.log
Hello everyone I am trying to install the native-base directory and I get this error anyone know how to fix this? Thanks in advance!
If that helps i am working on macbook pro m1
This command may solve your problem:
npm install native-base --force
or
npm install native-base --legacy-peer-deps
I faced this problem today, so I used yarn add native-base instead of npm.