Fixing EPEERINVALID

Problem

Sometimes a module can require that it’s dependencies have a different version of a sibling.

Below, you’ll notice that enzyme is a sibling module with these modules:

npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@15.3.2 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-native@0.30.0 wants react@15.3.1
npm ERR! peerinvalid Peer react-addons-test-utils@0.14.8 wants react@15.3.1
npm ERR! peerinvalid Peer enzyme@2.4.1 wants react@0.13.x || 0.14.x || ^15.0.0–0
npm ERR! peerinvalid Peer react-native-mock@0.0.6 wants react@*

react-native, react-test-renderer, react-addons-test-utils, react-native-mock and react.

However enzyme in the it’s package.json you’ll find that

“peerDependencies”: {
“react”: “0.13.x || 0.14.x || ^15.0.0–0”
}

want’s 0.13.x, 0.14.x, and ^15.0.0–0 versions of react.

Solution

Change

“react”: “0.13.x || 0.14.x || ^15.0.0–0”

to

“react”: “15.3.2”

do the same to all modules with different versions of react.