1

I am trying to setup material dashboard from

git clone https://github.com/creativetimofficial/material-dashboard-react.git.

Using node-16

I run npm install

I get

npm ERR! While resolving: material-dashboard-react@1.10.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! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0" from react-swipeable-views@0.13.9
npm ERR! node_modules/react-swipeable-views
npm ERR!   react-swipeable-views@"0.13.9" 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 /home/simha/.npm/eresolve-report.txt for a full report.

How can I resolve this.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Santhosh
  • 9,965
  • 20
  • 103
  • 243

1 Answers1

2

It looks like the root project installs react@17.0.2. But "react-swipeable-views" requires version 15 or 16 of react.

Edit: As a first option, you could try updating "react-swipeable-views" to its latest version. It may possibly support React 17. The following command will update it.

npm install react-swipeable-views@latest

If this doesn't work...

Try reducing the numbers for react in the package.json to something in the 16.x.x range, then re-run

npm install

so it will satisfy the peer dependency.

https://docs.npmjs.com/about-semantic-versioning

If you're not familiar with NPM semantic versioning, use this calculator. Enter react -> "^16.0.0" to see that it does not include 17

https://semver.npmjs.com/

Josiah Monks
  • 71
  • 1
  • 6