3

After running yarn upgrade and installing the peer dependencies in my package.json, I cannot get rid of the warnings. I understand that warnings won't actually stop my code from running, but I'd like to try to minimize them as much as possible so that there are no warnings and clean installation looks nice.

Here is my package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "peerDependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "^0.44.1",
    "@babel/core": "^7.0.0-0"
  },
  "dependencies": {
    "@babel/core": "^7.0.0-0",
    "@expo/samples": "2.1.1",
    "expo": "^31.0.2",
    "react-navigation": "^2.18.2",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0",
    "install-peers": "^1.0.3",
    "jest-expo": "^31.0.0",
    "prop-types": "^15.0.0",
    "react": "^16.6.3",
    "react-native": "^0.57.1"
  },
  "private": true
}

terminal:

$ trash yarn.lock; trash node_modules; yarn
yarn install v1.12.3
info No lockfile found.
[1/4]   Resolving packages...
warning jest-expo > jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
[2/4]   Fetching packages...
[3/4]   Linking dependencies...
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react@16.0.0-alpha.6".
warning "expo > react-native-reanimated@1.0.0-alpha.10" has incorrect peer dependency "react-native@^0.44.1".
warning " > react-native@0.57.7" has incorrect peer dependency "react@16.6.1".
[4/4]   Building fresh packages...
success Saved lockfile.
✨  Done in 19.19s.
Gelok
  • 174
  • 3
  • 10

1 Answers1

1

To get rid of this warning for example:

react-native@0.57.7" has incorrect peer dependency "react@16.6.1"

Try command

npm install react@16.6.1

because react-native has a dependency on react's particular version.

Samuel Philipp
  • 10,631
  • 12
  • 36
  • 56
DaminiVyas
  • 308
  • 3
  • 15