I created brand new nextjs project today but it is giving me error when install packages
Unanswered
English Angora posted this in #help-forum
English AngoraOP
The error is this
node_modules/react
npm error react@"19.0.0-rc-66855b96-20241106" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@">=16.8.0" from formik@2.4.6
I'm installing formik and react query
node_modules/react
npm error react@"19.0.0-rc-66855b96-20241106" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@">=16.8.0" from formik@2.4.6
I'm installing formik and react query
3 Replies
try npm i --legacy-peer-deps
English AngoraOP
why i need --legacy-peer-deps?
@English Angora The error is this
node_modules/react
npm error react@"19.0.0-rc-66855b96-20241106" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@">=16.8.0" from formik@2.4.6
I'm installing formik and react query
This error is happening because you are currently using React 19 RC, as setup by nextjs.
formik requires a peer dependency of react, of a older version.
There are 3 fixes to this problem:
- Downgrade next & React to a lower version
- Check if there is a alpha/beta version of formilk/react query with latest react support
- Run with --legacy-peer-deps, which'll ignore the warning and continue installing. You might get some errors if it doesn't work
formik requires a peer dependency of react, of a older version.
There are 3 fixes to this problem:
- Downgrade next & React to a lower version
- Check if there is a alpha/beta version of formilk/react query with latest react support
- Run with --legacy-peer-deps, which'll ignore the warning and continue installing. You might get some errors if it doesn't work