yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.46k stars 2.73k forks source link

Incorrect peer dependency "react@16.5.0" #6401

Open flexaddicted opened 6 years ago

flexaddicted commented 6 years ago

Do you want to request a feature or report a bug?

I want to report a bug.

What is the current behavior?

Running yarn install I receive the following warning:

warning " > react-native@0.57.0" has incorrect peer dependency "react@16.5.0".

If the current behavior is a bug, please provide the steps to reproduce.

This is the package.json file I'm using:

"dependencies": {
    "@babel/polyfill": "^7.0.0",
    "ent": "^2.2.0",
    "jssha": "^2.3.1",
    "lodash": "^4.17.10",
    "moment": "^2.19.4",
    "moment-timezone": "^0.5.17",
    "react": "^16.5.2",
    "react-native": "^0.57",
    "react-native-elements": "^0.19.1",
    "react-native-fast-image": "^4.0.14",
    "react-native-htmlview": "^0.13.0",
    "react-native-hyperlink": "0.0.11",
    "react-native-remote-svg": "^1.2.0",
    "react-native-scrollable-tab-view": "^0.8.0",
    "react-native-svg": "^6.3.1",
    "react-native-vector-icons": "^5.0.0",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-saga": "^0.16.0",
    "reselect": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0",
    "babel-core": "7.0.0-bridge.0",
    "@babel/preset-env": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
    "babel-plugin-transform-inline-environment-variables": "^0.4.3",
    "concurrently": "^2.2.0",
    "jest": "^23.6.0",
    "metro-react-native-babel-preset": "^0.45.2",
    "msvgc": "^0.1.1",
    "prettier": "1.9.2",
    "react-dom": "^16.3.0-alpha.1",
    "react-native-storybook-loader": "^1.6.0"
  }

What is the expected behavior?

The warning should not be present.

Please mention your node.js, yarn and operating system version.

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
      Memory: 589.27 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.8.0 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.2.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.5.2 => 16.5.2 
      react-native: ^0.57 => 0.57.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-git-upgrade: 0.2.7
yarn version v1.9.4
rally25rs commented 6 years ago

You are installing react-native@0.57.0 which has a peerDep on react@16.5.0 (that exact version). However you are installing "react": "^16.5.2" which will never match 16.5.0 so this warning correctly appears (16.5.2 != 16.5.0)

You could change your dependency to "react": "16.5.0"

Maybe the message is slightly unclear. It's really saying that the peer dependency react@16.5.0 is unmet.

flexaddicted commented 6 years ago

@rally25rs Thanks for the reply.

Here my question to the RN team:

https://github.com/facebook/react-native/issues/21175

pronebird commented 6 years ago

That's the issue of one particular package. I don't think anything can be done here.