capacitor-community / react-hooks

⚡️ React hooks for Capacitor ⚡️
Other
246 stars 22 forks source link

ERESOLVE unable to resolve dependency tree #32

Open santoshgistto opened 3 years ago

santoshgistto commented 3 years ago

Describe the bug unable to resolve dependency tree once we upgraded to latest version of capacitor
To Reproduce npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: myproject@0.0.1 npm ERR! Found: @capacitor/core@3.2.3 npm ERR! node_modules/@capacitor/core npm ERR! @capacitor/core@"^3.2.3" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @capacitor/core@"~1.3.0" from @ionic/react-hooks@0.0.8 npm ERR! node_modules/@ionic/react-hooks npm ERR! @ionic/react-hooks@"0.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.

Expected behavior Should install

mattbatman commented 2 years ago

I have the same problem after upgrading Node from ~v14 to ~v16. My impression from the README is that @ionic/react-hooks is no longer needed after upgrading capacitor. However, after removing it from my project, useRef no longer works.

elylucas commented 2 years ago

@ionic/react-hooks (the old library) and @capacitor-community/react-hooks (the lib for cap v2), are not supported in capacitor v3. Check the readme for instructions on how to use with Capacitor v3