"Could not resolve dependency" error during npm install

Viewed 33

i am trying npm install but getting following error. i have tried using the --force and --legacy-peer-deps arguments but they did not work

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-checkmark@1.4.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@">=16.8.0" from @emotion/react@11.10.4
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"^11.10.4" from the root project
npm ERR!     peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.10.4
npm ERR!     node_modules/@emotion/styled
npm ERR!       @emotion/styled@"^11.10.4" from the root project
npm ERR!       3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR!     3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR!   46 more (@emotion/styled, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.6" from react-checkmark@1.4.0
npm ERR! node_modules/react-checkmark
npm ERR!   react-checkmark@"^1.4.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.6" from react-checkmark@1.4.0
npm ERR!   node_modules/react-checkmark
npm ERR!     react-checkmark@"^1.4.0" 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\HRICK SARKAR\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HRICK SARKAR\AppData\Local\npm-cache\_logs\2022-09-19T15_51_36_949Z-debug-0.log
1 Answers

The version of react-checkmark you have has a peer dependency of react 16.14.0 and your project is react 17.0.2. Downgrading your react version until the checkmark library is compatible with react 17 should fix your issue.

Related