nx-react-native-expo
nx-react-native-expo copied to clipboard
Cannot install with nx 11.4.0
Here is the output I get when trying to install
git:(main) npm i -D nx-react-native-expo --force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN peer react@">=16.0.0" from @ant-design/[email protected]
npm WARN node_modules/@ant-design/icons
npm WARN @ant-design/icons@"^4.5.0" from [email protected]
npm WARN node_modules/antd
npm WARN 72 more (@emotion/core, @emotion/styled, @emotion/styled-base, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"16.13.1" from [email protected]
npm WARN node_modules/react-native
npm WARN peer react-native@"^0.63.0" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/jest
npm WARN @nrwl/jest@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/jest
npm WARN @nrwl/jest@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/linter
npm WARN @nrwl/linter@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/linter
npm WARN @nrwl/linter@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/react
npm WARN @nrwl/react@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: @nrwl/[email protected]
npm WARN node_modules/@nrwl/workspace
npm WARN @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/cypress
npm WARN @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm WARN node_modules/@nrwl/react
npm WARN 3 more (@nrwl/storybook, @nrwl/web, the root project)
npm WARN 5 more (@nrwl/react, @nrwl/storybook, @nrwl/web, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm WARN node_modules/nx-react-native-expo/node_modules/@nrwl/react
npm WARN @nrwl/react@"10.4.4" from [email protected]
npm WARN node_modules/nx-react-native-expo
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: @nrwl/[email protected]
npm ERR! node_modules/@nrwl/workspace
npm ERR! @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/cypress
npm ERR! @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/react
npm ERR! dev @nrwl/react@"^11.4.0" from the root project
npm ERR! @nrwl/cypress@"11.4.0" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/storybook
npm ERR! @nrwl/storybook@"11.4.0" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/react
npm ERR! dev @nrwl/react@"^11.4.0" from the root project
npm ERR! 1 more (the root project)
npm ERR! 2 more (@nrwl/web, the root project)
npm ERR! @nrwl/workspace@"11.4.0" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/react
npm ERR! dev @nrwl/react@"^11.4.0" from the root project
npm ERR! 4 more (@nrwl/storybook, @nrwl/web, the root project, nx-react-native-expo)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nrwl/workspace@"10.4.4" from @nrwl/[email protected]
npm ERR! node_modules/nx-react-native-expo/node_modules/@nrwl/cypress
npm ERR! @nrwl/cypress@"10.4.4" from @nrwl/[email protected]
npm ERR! node_modules/nx-react-native-expo/node_modules/@nrwl/react
npm ERR! @nrwl/react@"10.4.4" from [email protected]
npm ERR! node_modules/nx-react-native-expo
npm ERR! dev nx-react-native-expo@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/jeff/.npm/eresolve-report.txt for a full report.
I was able to get this package installed by passing the --legacy-peer-deps but when I try to use the generator it errors with the following:
git:(react-native) ✗ npx nx g nx-react-native-expo:app mobile
⠙ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.13.1" from [email protected]
npm ERR! node_modules/react-native
npm ERR! react-native@"https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/jeff/.npm/eresolve-report.txt for a full report.
After digging in a little the problem seems to stem from a combination of factors:
- starting with node 15 which uses npm 7 which has changed the lockfile format (to version 2) and treats peer dependencies differently
- react has bumped up to version 17.0.1 while not making any breaking changes (except under the hood) but
- react-native v 0.63.x still points to react version 16 as a peer (v0.64.0-rc1 goes to react 17)
- @nrwl/react pinned itself to v is 17 in Nov 2020
- @nrwl/react-native is still pinned to v 0.63.0 for react-native
It seems that until these other dependencies are cleared up, it's not possible to use npm 7 with nx packages using react-native