javascriptreactjsnpmreact-quill

ERESOLVE unable to resolve dependency tree while installing a pacakge


While installing the dependencies for my project using npm install, I receive the following error that I don't know how to interpret:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: soft-ui-dashboard-pro-react@3.1.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@"^0.14.9 || ^15.3.0 || ^16.0.0" from react-quill@1.3.5
npm ERR! node_modules/react-quill
npm ERR!   react-quill@"1.3.5" 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 /Users/amin/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/amin/.npm/_logs/2022-03-23T05_47_43_419Z-debug-0.log

These are the dependencies in package.json:

  "dependencies": {
    "@asseinfo/react-kanban": "2.2.0",
    "@emotion/cache": "11.7.1",
    "@emotion/react": "11.8.1",
    "@emotion/styled": "11.8.1",
    "@fullcalendar/daygrid": "5.10.1",
    "@fullcalendar/interaction": "5.10.1",
    "@fullcalendar/react": "5.10.1",
    "@fullcalendar/timegrid": "5.10.1",
    "@mui/icons-material": "5.4.2",
    "@mui/material": "5.4.3",
    "@mui/styled-engine": "5.4.2",
    "@pathofdev/react-tag-input": "1.0.7",
    "@react-leaflet/core": "1.1.1",
    "@testing-library/jest-dom": "5.16.2",
    "@testing-library/react": "12.1.3",
    "@testing-library/user-event": "13.5.0",
    "@three-ts/orbit-controls": "1.4.7",
    "chart.js": "3.4.1",
    "chroma-js": "2.4.2",
    "dropzone": "5.9.3",
    "flatpickr": "4.6.9",
    "formik": "2.2.9",
    "html-react-parser": "1.4.8",
    "leaflet": "1.7.1",
    "prop-types": "15.8.1",
    "react": "17.0.2",
    "react-chartjs-2": "3.0.4",
    "react-circular-slider-svg": "0.1.5",
    "react-countup": "6.1.1",
    "react-dom": "17.0.2",
    "react-flatpickr": "3.10.7",
    "react-github-btn": "1.2.1",
    "react-images-viewer": "1.7.1",
    "react-leaflet": "3.2.5",
    "react-quill": "1.3.5",
    "react-router-dom": "6.2.1",
    "react-scripts": "5.0.0",
    "react-select": "5.2.2",
    "react-table": "7.7.0",
    "stylis": "4.0.13",
    "stylis-plugin-rtl": "2.1.1",
    "sweetalert2": "11.4.4",
    "three": "0.121.1",
    "uuid": "8.3.2",
    "vanilla-tilt": "1.7.2",
    "web-vitals": "2.1.4",
    "yup": "0.32.11"
  },

Solution

  • It means you have dependency conflicts. So try running the following options one by one.

    1. Remove node_modules and package-lock.json and then run

     npm install
    

    2. Or try clearing out npm cache

    npm cache clean --force
    

    3. Or run command with --legacy-peer-deps option

    npm install --legacy-peer-deps
    

    4. Or run command with --force option

    npm install --force