Installing packages breaks my projects (peer dependency complaints)

Using Expo XDE.
I generate a new project.
It runs on my device.
I try yarn add react-native-router-flux react-native-square-grid and then I end up with peer dependency warnings.

warning "expo > expo-camera@1.0.1" has incorrect peer dependency "react@^16.4.0".  
warning "expo > expo-gl@1.0.1" has incorrect peer dependency "react@^16.4.0".  
warning "expo > react-native-maps@0.21.0" has incorrect peer dependency "react-native@^0.51 || ^0.52 || ^0.53 || ^0.54".  
warning "expo > react-native-reanimated@1.0.0-alpha.3" has incorrect peer dependency "react@16.0.0- alpha.6".  
warning "expo > react-native-reanimated@1.0.0-alpha.3" has incorrect peer dependency "react- native@^0.44.1".  
warning "react-native > eslint-plugin-react-native@3.2.1" has unmet peer dependency "eslint@^3.17.0 || ^4.0.0".  
warning " > react-native-square-grid@1.0.5" has incorrect peer dependency "react-native@^0.42.0".  
warning " > react-native-square-grid@1.0.5" has incorrect peer dependency "react@^15.4.0".

But package.json is fine:

"dependencies": {
  "expo": "^29.0.0",
  "react": "16.3.1",
  "react-native": "https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz",
  "react-native-router-flux": "^4.0.1",
 "react-native-square-grid": "^1.0.5"
}

Expo Xde has a separate warning:

"Warning: ‘react’ peer dependency missing. Run npm ls in /Users/d/Projects/React-Native/futoshikimobile to see full warning. Warning: ‘react-native’ peer dependency missing. Run npm ls in /Users/d/Projects/React-Native/futoshikimobile to see full warning.

If there is an issue running your project, please run npm install in /Users/d/Projects/React-Native/futoshikimobile and restart. "

Yet I’m told it’s already up to date when I npm install.

UPDATE: Making a new project and running npm install before doing anything else results in the same exact error.

Hey @zbsedefian,

Does your project actually break? From my experience, these peer dependency warnings often don’t affect a project.

Cheers,

Adam

Hi Adam, yes, the project refuses to start.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.