ERESOLVE 在安装包时无法解析依赖树

ERESOLVE unable to resolve dependency tree while installing a pacakge

在使用 npm install 为我的项目安装依赖项时,我收到以下我不知道如何解释的错误:

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

这些是 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"
  },

这意味着你有依赖冲突。因此,尝试 运行 将以下选项一一列出。

1.删除 node_modulespackage-lock.json 然后 运行

 npm install

2。或者尝试清除 npm 缓存

npm cache clean --force

3。或带有 --legacy-peer-deps 选项的 运行 命令

npm install --legacy-peer-deps

4.或带有 --force 选项的 运行 命令

npm install --force