NativeBase
NativeBase copied to clipboard
ERESOLVE unable to resolve dependency tree
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
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
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
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!
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)
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.
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 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.
I'm just getting this :-(
Sucks that I can't use Native base for now :-(
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 , thanks!
This issue has been fixed in version 3.4.9
or later. Please feel free to reopen if this problem persists. Thanks ❤️
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