HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
240 stars 68 forks source link

Update react dependency #155

Closed peltax closed 7 months ago

peltax commented 2 years ago

Hello, react dependency is hardcoded to 16.x in package.json. This prevents npm installation without "--legacy-peer-deps" flag if one is using newer react-native such as 0.64, that uses react 17.x. Please update all react-native npm packages to allow other react versions.

npm i @hmscore/react-native-hms-availability npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: project@1.0.0 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.6.0" from @hmscore/react-native-hms-availability@5.2.0-300 npm ERR! node_modules/@hmscore/react-native-hms-availability npm ERR! @hmscore/react-native-hms-availability@"*" 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.

peltax commented 2 years ago

Is there plans to go for a bugfix triage?

UgurBas commented 2 years ago

Hi @peltax ,

We have tested our plugins with the latest version of React Native. The problem occurs when npm version is greater than 6. We advise you to change your node version to 14.

If the issue persists, please feel free to contact us. Thank you for helping us to improve our plugins.

tarouboy commented 2 years ago

I am using node version 18.2.0 and same here. ( RN 0.66 ) Can't do npm install with "--legacy-peer-deps" flag.

However, using yarn is fine.