webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
134 stars 83 forks source link

Upgraded RN to 0.63.2 - "Could not resolve dependency" #40

Open oporter1 opened 3 years ago

oporter1 commented 3 years ago

I upgraded my expo project which upgraded my RN version to 0.63.2

When I try to run npm install react-native-deck-swiper --save the below error is returned:

npm ERR! Found: react-native@0.63.2
npm ERR! node_modules/react-native
npm ERR!   react-native@"https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.49.1" from react-native-deck-swiper@2.0.5

It looks like this package is requiring an older version of RN? Do you have any idea why it would be rejecting me?

My Expo Specs:

  Expo CLI 4.0.4 environment info:
    System:
      OS: macOS 11.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 15.3.0 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 7.0.14 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 14.3, DriverKit 20.0, macOS 11.1, tvOS 14.3, watchOS 7.2
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.6953283
      Xcode: 12.3/12C5020f - /usr/bin/xcodebuild
    npmPackages:
      expo: ^39.0.0 => 39.0.5 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2 
      react-navigation: ^3.13.0 => 3.13.0 
    npmGlobalPackages:
      expo-cli: 4.0.4
    Expo Workflow: managed
webraptor commented 3 years ago

Hi @oporter1, the project requires RN version 0.49.1 or later, I doubt that this is the issue. In any case, 0.49.1 was released more than 3 years ago. I'm thinking we could update that to 0.53 (released January 2018) to keep last 2 years supported.

If you can manage to open up a PR for this, merge & release should be rather quick.

witZack commented 3 years ago

warning " > react-native-deck-swiper@2.0.5" has incorrect peer dependency "react-native@^0.49.1".

is the warning i am getting when i try to install with yarn, and the module is not recognized as existing by my package / editor.

MidknightMan commented 3 years ago

+1 Having some big issues trying to install this without legacy deps with Expo 40 SDK. Just bumping to see if it's an issue for anyone else.

Rainymood commented 3 years ago

Running into the same issue peer dependency. Using expo.

omgitsfaraaz commented 2 years ago

Hi @oporter1 , Did it work for you after downgrading the RN version to 0.49.1 ?

cb-eli commented 1 year ago

Same issue here. Any idea how to overcome it? I'm using the bare workflow, expo is not installed.

While resolving: test-project@0.0.1
Found: react-native@0.69.1
node_modules/react-native
  react-native@"0.69.1" from the root project

Could not resolve dependency:
peer react-native@"^0.49.1" from react-native-deck-swiper@2.0.10
node_modules/react-native-deck-swiper
  react-native-deck-swiper@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
benbrunyee commented 1 year ago

Same issue here, my project is using expo ~45.0.0 & react-native 0.68.2

konnraad commented 1 year ago

Same issue here, my project is using expo ~45.0.0 & react-native 0.68.2

Same issue here. Any idea how to overcome it? I'm using the bare workflow, expo is not installed.

While resolving: test-project@0.0.1
Found: react-native@0.69.1
node_modules/react-native
  react-native@"0.69.1" from the root project

Could not resolve dependency:
peer react-native@"^0.49.1" from react-native-deck-swiper@2.0.10
node_modules/react-native-deck-swiper
  react-native-deck-swiper@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

@cb-eli @benbrunyee @MidknightMan @Rainymood

Hey Guys, you need to switch from npm to yarn. That's quite simple! First install yarn with the command npm install yarn Then you must remove the package-lock.json After that, just type in your PowerShell npx yarn, this command is going to install all your Packages that you installed with npm. Then you should be good to go. To add new Packages, you just need to write npx yarn add <Packagename>

webraptor commented 1 year ago

@kondel1 if you can open a PR that would be great!

konnraad commented 1 year ago

@webraptor This is only a workaround and not a troubleshooting. I guess when you would change the "react-native": "^0.49.1" to "react-native": "*" in the package.json, it should solve the problem for npm users.

My change would be look like this.

"peerDependencies": { "react": "^16.0.0-beta.5 || ^17.0.0 || ^18.0.0", *"react-native": ""** },

BUT I'M NOT SURE...(that's why I'm not gonna open a PR) Maybe you can try it ;:)