Incompatible peer dependencies in a workspace with Next.js and Expo projects
See original GitHub issueCurrent Behavior
The latest version of @nrwl/next
has a peerDependency
on Next.js 12, which in turn has a peer dependency on React 17.0.2 or above. The new @nrwl/expo
has a peer dependency on the latest ‘expo’, which has a peer dependency on react-native 0.64.3 which supports React 17.0.1 only. Using npm it seems impossible to have both types of projects in the same workspace without using legacy peer dependencies (which is risky and breaks stuff).
Steps to Reproduce
- Create a new nx workspace
nx g @nrwl/next:app next-app
nx g @nrwl/expo:app expo-app
npm install
Failure Logs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: boilerplate-app@0.0.0
npm ERR! Found: react@17.0.1
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@"^17.0.2 || ^18.0.0-0" from next@12.1.2
npm ERR! node_modules/next
npm ERR! next@"12.1.2" from the root project
npm ERR! peer next@">=10.2.0" from eslint-config-next@12.1.5
npm ERR! node_modules/eslint-config-next
npm ERR! dev eslint-config-next@"^12.1.5" 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.
Environment
Node : 14.19.1
OS : linux x64
npm : 8.1.0
nx : 13.10.2
@nrwl/angular : Not Found
@nrwl/cypress : 13.10.2
@nrwl/detox : 13.10.2
@nrwl/devkit : 13.10.2
@nrwl/eslint-plugin-nx : 13.10.2
@nrwl/express : Not Found
@nrwl/jest : 13.10.2
@nrwl/js : 13.10.2
@nrwl/linter : 13.10.2
@nrwl/nest : Not Found
@nrwl/next : 13.10.2
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 13.10.2
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 13.10.2
@nrwl/web : 13.10.2
@nrwl/workspace : 13.10.2
typescript : 4.3.5
rxjs : 6.6.7
---------------------------------------
Community plugins:
@nrwl/expo: 13.9.0
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Working with monorepos - Expo Documentation
This guide will set up a simple monorepo with an Expo project. We currently have first-class support for Yarn 1 (Classic) workspaces.
Read more >Incompatible peer dependencies found - upgrading Angular ...
Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work ...
Read more >@nrwl/next: Versions | Openbase
Full version history for @nrwl/next including change logs. ... nextjs: remove dependency on "@nrwl/next" for the production build (#12247) (50f6cbb) ...
Read more >npm err! code eresolve npm err! eresolve could not resolve ...
It means you have dependency conflicts. So try running the following options one by one. Remove node_modules and package-lock.json and then run. npm...
Read more >.npmrc | pnpm
per-project configuration file ( /path/to/my/project/.npmrc ); per-workspace ... When true , all dependencies are hoisted to node_modules/.pnpm .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m running into this issue as well. Building Nextjs web app with an Expo React native application.
npm install --save-dev @nrwl/next
nx g @nrwl/next:app my-new-app
npm install -D @nrwl/expo
nx g @nrwl/expo:app my-expo-new-app
Both apps seem to run properly until someone else clones repo and runs
npm i
You get an error such as this onei think after you upgrade to latest @nrwl/expo version, it will be able to use react 18 with it.