Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to install on React 17 #20

Open
Erdou opened this issue Feb 8, 2021 · 3 comments
Open

Impossible to install on React 17 #20

Erdou opened this issue Feb 8, 2021 · 3 comments

Comments

@Erdou
Copy link

Erdou commented Feb 8, 2021

Describe the bug
With the latest (at this date) React 17 and NPM with lock files v2, it is impossible to install without forcing dependencies:

λ npm install @capacitor-community/react-hooks
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: greendays@1.1.6
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.6" from @capacitor-community/react-hooks@0.0.11
npm ERR! node_modules/@capacitor-community/react-hooks
npm ERR!   @capacitor-community/react-hooks@"*" 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.

To Reproduce
Steps to reproduce the behavior:

λ npm install -g @ionic/cli
λ ionic start myApp blank --type=react
λ cd myApp
λ npm install @capacitor-community/react-hooks
@Erdou
Copy link
Author

Erdou commented Feb 8, 2021

The workaround is:

λ npm install @capacitor-community/react-hooks --legacy-peer-deps

I've tested an app where I use a lot of different hooks from this package and everything seems fine. I think we just need to update the dependencies to accept React 17.

@blatoo
Copy link

blatoo commented Apr 6, 2021

The workaround is:

λ npm install @capacitor-community/react-hooks --legacy-peer-deps

I've tested an app where I use a lot of different hooks from this package and everything seems fine. I think we just need to update the dependencies to accept React 17.

Hi Erdou, with your method, I installed it in React 17 successfully, but I can not get any type description...

@drakonkat
Copy link

drakonkat commented Feb 16, 2022

I have the same issue, forcing it seems to have no problem with react 17. Is possible to update the dependencies to accept React 17?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants