react-native-clipboard / clipboard

React Native Clipboard API for both iOS and Android.
MIT License
687 stars 135 forks source link

Installation error #255

Open WeiTeck13 opened 2 weeks ago

WeiTeck13 commented 2 weeks ago

I perform npm install --save @react-native-clipboard/clipboard and receive the following error:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: ServicePack@0.0.1
npm error Found: react@18.3.1
npm error node_modules/react
npm error   react@"18.3.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"16.9.0 || 16.11.0 || 16.13.1 || 17.0.1 || 17.0.2 || 18.0.0 || 18.1.0 || 18.2.0" from @react-native-clipboard/clipboard@1.14.1
npm error node_modules/@react-native-clipboard/clipboard
npm error   @react-native-clipboard/clipboard@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\user\AppData\Local\npm-cache\_logs\2024-08-27T03_25_35_903Z-eresolve-report.txt

npm error A complete log of this run can be found in: C:\Users\user\AppData\Local\npm-cache\_logs\2024-08-27T03_25_35_903Z-debug-0.log

I am not very sure why this happens. Can you please help me? Thank you.

tommmoe commented 2 weeks ago

wow, bots.

Also this error means that the package has a dependency on older versions of React, the latest version 18.3.1 isn't supported yet, which sucks, I'm also in the same boat.

edit looks like you can still use the old API method, I don't think it's being removed until React 19 https://reactnative.dev/docs/clipboard

AktilaCengiz commented 2 weeks ago

How can be use this? I can't install this package other core package is a deprecated. How can i add ?

vishalsohani27 commented 2 weeks ago

just go with --legacy-peer-deps. i know its not good way. but go head is better then stuck.. hope in next version it will be resolved.

kneel2023 commented 1 week ago

If you’re encountering issues with React Native versions above 0.73, consider trying an alternative package like expo-clipboard (available at npm).

Alternatively, you could downgrade React Native to version 0.73.0 to avoid these issues, but be aware that this may introduce other errors or compatibility problems.

felansu commented 4 days ago

I don't understand nothing, here in https://reactnative.dev/docs/clipboard version 0.75 says:

Removed. Use one of the community packages instead.

But you try to use the react-native-clipboard/clipboard in version 0.75, says is not compatible?

kneel2023 commented 4 days ago

I don't understand nothing, here in https://reactnative.dev/docs/clipboard version 0.75 says:

Removed. Use one of the community packages instead.

But you try to use the react-native-clipboard/clipboard in version 0.75, says is not compatible?

Can you explain more about what you are facing ?

seems like you are referring to 0.75 version of react native

try : https://www.npmjs.com/package/expo-clipboard

image

felansu commented 4 days ago

Im using https://react-native-community.github.io/upgrade-helper/?from=0.74.5&to=0.75.2

"react": "18.3.1",
"react-native": "0.75.2"

and i don't use expo

-- Extra -- if like to know why, that is what i think

felansu commented 4 days ago

just found that fork https://github.com/bravetechnologycoop/clipboard-react-18.3 is that what need to do? https://github.com/bravetechnologycoop/clipboard-react-18.3/commit/7547b67d0e78898840e11bbdbce7b5ae79d4e563

kneel2023 commented 3 days ago

and i don't use expo

-- Extra -- if like to know why, that is what i think

I understand that you don't use Expo, and that's perfectly fine—it's a matter of personal preference whether you choose React Native CLI or Expo.

However, it's worth noting that the landscape for Expo has evolved significantly over the past four years. If you're interested, you can read more about these changes and how Expo has improved:

A Reddit discussion from 2024 about who is using Expo Another discussion highlighting how Expo has evolved [To Expo or not to Expo?] https://www.reddit.com/r/reactnative/comments/1dejx21/to_expo_or_not_to_expo/ These resources provide insight into how Expo has grown and the benefits it now offers.