0

Installing ANTV fails without --legacy-peer-deps option.

NPM install fails with: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @ant-design/charts@1.4.2 npm ERR! Found: @ant-design/icons@5.0.1 npm ERR! node_modules/@ant-design/icons npm ERR! @ant-design/icons@"^5.0.1" from the root project npm ERR! @ant-design/icons@"^5.0.0" from antd@5.1.6 npm ERR! node_modules/antd npm ERR! antd@"^5.1.6" from the root project npm ERR! peer antd@">=4.4.2 || >=5.0.0-beta.0" from @antv/x6-react-components@1.1.20

Package.json looks like: "engines": { "node": "18.x", "npm": "8.x" }, "dependencies": { "@ant-design/charts": "^1.4.2", "@ant-design/icons": "^5.0.1", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", "antd": "^5.1.6", "classnames": "^2.3.2", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.8.0", "react-scripts": "5.0.1", "serve": "^14.2.0", "web-vitals": "^2.1.4" },

  • Please format the error message and package.json in code blocks to make them easier to read. See https://stackoverflow.com/help/formatting – asportnoy Feb 24 '23 at 15:36

1 Answers1

0

I had a similar issue. There is currently a conflict between the @ant-design/charts and @ant-design/icons packages. You can read more about it here.

I fixed my issue by selectively installing the needed antd charts. For example instead of installing @ant-design/charts, I installed @ant-design/plots.

joshi
  • 45
  • 6
  • Thanks @joshi - I've had a look at the thread you pointed. I tried the "overrides" method listed but it wasn't that good and did fall back to the "npm i @ant-design/plots" you suggested and which works fine – user21279941 Apr 15 '23 at 10:41