🐛 Bug Report
Installing library with React Native 0.64 and npm7 fails due to a peer dependency error.

Yes
To Reproduce
(Write your steps here:)
- Install node and npm 7:
npm install -g npm@7
- Create a new react native project, telling the script to use npm as the package manager:
npx react-native init NavigationProject --npm
- Go into the new folder and try to install react-native-navigation:
cd NavigationProject; npm install react-native-navigation
Expected behavior
Install should succeed
Actual Behavior
Install failed.
On further inspection, this is due to the following:
- react-native-navigation has a dependency on
remx@3.x.x
- This resolves to
remx@3.0.611, which has a dependency on mobx-react@^5.2.3
- This resolves to
mobx-react@5.4.4, which has a peerDependency on react@"^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0" (note: not react@17)
Since React Native 0.64 has a peer dependency on React 17, this is the version installed when running npx react-native init. npm v7's default behaviour when a peer dependency can't be fulfilled is to fail the installation, which is what is happening in this case: mobx-react@5.4.4 does not list react@17 as a peerDep.
There is a workaround, to run npm install --legacy-peer-deps which reverts back to npm v6 behaviour - but this isn't particularly elegant.
Your Environment
- React Native Navigation version: 7.18.0
- React Native version: 0.64.2
- Platform(s) (iOS, Android, or both?): both
- Device info (Simulator/Device? OS version? Debug/Release?): N/A
- Node version: 14.16.1
- npm version: 7.9.0
Reproducible Demo
(Paste the link to an example repo and exact instructions to reproduce the issue.)
https://github.com/studiozeffa/react-native-navigation-peerdep-issue
- Clone the above
- Make sure you are using npm v7 (
npm install -g npm@7)
- Run
npm install
This will reproduce the issue.
🐛 Bug Report
Installing library with React Native 0.64 and npm7 fails due to a peer dependency error.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
(Write your steps here:)
npm install -g npm@7npx react-native init NavigationProject --npmcd NavigationProject; npm install react-native-navigationExpected behavior
Install should succeed
Actual Behavior
Install failed.
On further inspection, this is due to the following:
remx@3.x.xremx@3.0.611, which has a dependency onmobx-react@^5.2.3mobx-react@5.4.4, which has a peerDependency onreact@"^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0"(note: not react@17)Since React Native 0.64 has a peer dependency on React 17, this is the version installed when running
npx react-native init. npm v7's default behaviour when a peer dependency can't be fulfilled is to fail the installation, which is what is happening in this case:mobx-react@5.4.4does not list react@17 as a peerDep.There is a workaround, to run
npm install --legacy-peer-depswhich reverts back to npm v6 behaviour - but this isn't particularly elegant.Your Environment
Reproducible Demo
(Paste the link to an example repo and exact instructions to reproduce the issue.)
https://github.com/studiozeffa/react-native-navigation-peerdep-issue
npm install -g npm@7)npm installThis will reproduce the issue.