NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

ERESOLVE unable to resolve dependency tree

Open jukialen opened this issue 2 years ago • 9 comments

Description

I'm getting communication

CodeSandbox/Snack link

None. Problem with instalation

Steps to reproduce

I created Expo project with template tabs. When I want to install I have : npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: nameAndVersiionProject npm ERR! Found: [email protected] npm ERR! node_modules/react-native-safe-area-context npm ERR! react-native-safe-area-context@"3.3.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native-safe-area-context@"3.1.9" from [email protected] npm ERR! node_modules/native-base npm ERR! native-base@"*" from the root project

I used npm update but this didn't help.

I deeted react-native-safe-area-context. I installed native base but I got the same communication for react-native-safe-area-context and react-native-svg (problem with nativebase version).

I tried through expo install native-base too. I have "react-dom": "17.0.1" and "react": "17.0.1"

NativeBase Version

3.3.7

Platform

  • [ ] Android
  • [ ] CRA
  • [X] Expo
  • [ ] iOS
  • [ ] Next

Other Platform

No response

Additional Information

No response

jukialen avatar Mar 28 '22 14:03 jukialen

I am getting this error at the time of native base installation npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"17.0.2" from the root project npm ERR! peer react@"" from [email protected] npm ERR! node_modules/native-base npm ERR! native-base@"3.3.7" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^18.0.0" from [email protected] npm ERR! node_modules/react-dom npm ERR! peer react-dom@"" from [email protected] npm ERR! node_modules/native-base npm ERR! native-base@"3.3.7" 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\Rajshree\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\Rajshree\AppData\Local\npm-cache_logs\2022-04-04T06_34_05_082Z-debug.log

Rajshreesingh avatar Apr 04 '22 06:04 Rajshreesingh

Same issue, I was following the getting started documentation but it does not work - 1. Setting up your project npx react-native init MyApp --template @native-base/react-native-template does not work neither using react native ✖ Installing dependencies error Error: Command failed: npm install npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"17.0.1" from the root project npm ERR! peer react@"" from [email protected] npm ERR! node_modules/native-base npm ERR! native-base@"3.3.7" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^18.0.0" from [email protected] npm ERR! node_modules/react-dom npm ERR! peer react-dom@"" from [email protected] npm ERR! node_modules/native-base npm ERR! native-base@"3.3.7" from the root project

janet-rivas avatar Apr 08 '22 14:04 janet-rivas

Having the same issue wih

"react": "17.0.2",
"react-native": "0.68.1",

npm install native-base --save npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/react npm ERR! react@"17.0.2" from the root project npm ERR! peer react@"*" from [email protected] 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!

neoassyrian avatar Apr 16 '22 07:04 neoassyrian

This is caused by this tiny little commit.

It only happens when using npx, so in the meantime, use yarn dlx to init a new project, it will work without any issue. (remember that you need yarn>=2.0.0 to do this)

Aziks0 avatar Apr 22 '22 22:04 Aziks0

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 22 '22 21:06 stale[bot]

I tried using yarn dlx like this:

yarn dlx react-native init MyApp --template @native-base/react-native-template

However it throws error:

yarn: error: no such option: --template

Feels sad to abandon a good library just because of not being able to get started :(

HeyItsJs avatar Jul 30 '22 06:07 HeyItsJs

@HeyItsJs I tried your exact command and it worked. Weird. I have no idea why.

Although, I said that you need yarn>=2.0.0 (because yarn dlx is a 2.x.y feature), but yarn -v prints out 1.22.15 on my machine.

Aziks0 avatar Jul 30 '22 07:07 Aziks0

I'm just getting this :-( image

Sucks that I can't use Native base for now :-(

Andrew-Pynch avatar Aug 02 '22 04:08 Andrew-Pynch

Can you please try the latest version 3.4.9? You can also try install "react-native-safe-area-context": "3.1.9" in your project. Please let me know if this issue persists.

surajahmed avatar Aug 03 '22 06:08 surajahmed

@surajahmed , thanks!

alexjs87 avatar Aug 29 '22 20:08 alexjs87

This issue has been fixed in version 3.4.9 or later. Please feel free to reopen if this problem persists. Thanks ❤️

surajahmed avatar Sep 12 '22 09:09 surajahmed

This issue has been fixed in version 3.4.9 or later. Please feel free to reopen if this problem persists. Thanks ❤️

This problem persists when using: npx react-native init MyApp --template @native-base/react-native-template-typescript

0xUniko avatar Oct 19 '22 06:10 0xUniko