pcodesdev
pcodesdev

Reputation: 41

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

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.
``

Upvotes: 4

Views: 4522

Answers (4)

Ahmad Maartmesrini
Ahmad Maartmesrini

Reputation: 19

the answer is in the given output i.e: all you need is to add

--legacy-peer-deps

Upvotes: 0

Real Uniquee
Real Uniquee

Reputation: 531

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';

Upvotes: 1

Doesn't Matter
Doesn't Matter

Reputation: 21

i got the same issue and i tried this command: npm i react-mde --force, but mde didn't work properly like the icons are not showing up

Upvotes: 0

Rohit Thorat
Rohit Thorat

Reputation: 81

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

Check this documentation

Upvotes: 6

Related Questions