Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-mde can't install on "react": "^18.2.0"

Tags:

reactjs

I am getting this error from the terminal while installing react-mde npm package:

  npm i react-mde

Above command gives error below:

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@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:       
npm ERR! peer react@"^17.0.0" from [email protected]
npm ERR! node_modules/react-mde
npm ERR!   react-mde@"*" 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 C:\Users\Peter.Njuguna\AppData\Local\npm-cache\eresolve-report.txt for a full report.
``
like image 210
pcodesdev Avatar asked Oct 16 '25 10:10

pcodesdev


2 Answers

try this npm i react-mde --legacy-peer-deps

Check this documentation

like image 99
Rohit Thorat Avatar answered Oct 18 '25 23:10

Rohit Thorat


react-mde does not support react 18 yet. To to use react-mde in react 18 use below command.

npm i react-mde --legacy-peer-deps

To use react-mde with its properties and its css styling import following:

import ReactMde from "react-mde";
import 'react-mde/lib/styles/css/react-mde-all.css';
like image 30
Real Uniquee Avatar answered Oct 19 '25 01:10

Real Uniquee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!