react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.61k stars 458 forks source link

React native dependency error with async storage #1069

Closed aydincankalyoncu closed 3 months ago

aydincankalyoncu commented 3 months ago

What happened?

After updating react native version to 0.74.0-rc.2 in React native project, the dependency could not be resolved when starting the project.

Error message:

Found: react-native@0.74.0-rc.2 npm ERR! node_modules/react-native npm ERR! react-native@"^0.74.0-rc.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native@"^0.0.0-0 || >=0.60 <1.0" from @react-native-async-storage/async-storage@1.22.3 npm ERR! node_modules/@react-native-async-storage/async-storage npm ERR! @react-native-async-storage/async-storage@"^1.21.0" from the root project

Version

1.21.0

What platforms are you seeing this issue on?

System Information

System:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M2
  Memory: 119.11 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.8.0
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.09.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/user/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11330709
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/user/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0-rc.2
    wanted: ^0.74.0-rc.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to Reproduce

Update the react native version to latest release candidate. Start the project with android.

tido64 commented 3 months ago

This is expected since according to npm, 0.74.0-rc.2 doesn't satisfy >=0.60 <1.0; prereleases aren't included when resolving ranges.

You can turn the error into a warning with a flag though. Try npm i --legacy-peer-deps instead (see strict-peer-deps).

Closing the issue since it's not an AsyncStorage bug.