compatible icon indicating copy to clipboard operation
compatible copied to clipboard

为什么1.1.2版本的peer dependencies中限制antd为3.x

Open joexzy opened this issue 3 years ago • 8 comments

1.1.2版本的@ant-design/compatible中的package.json里写有peer dependencies, antd为3.x。我理解这个是v3升级到v4的兼容包,那么宿主环境中装的antd版本应该是v4的,这里为什么要这么限制呢?同时因为我的项目必须升级至react17以上,所以也不可能有antd3共存在项目中。

joexzy avatar Oct 11 '22 11:10 joexzy

Same problem here, trying to install

  • @ant-design/compatible 1.1.2
  • antd 4.23.6
$ npm update --dry-run

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/antd
npm ERR!   dev antd@"^4.21.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer antd@"3.x" from @ant-design/[email protected]
npm ERR! node_modules/@ant-design/compatible
npm ERR!   dev @ant-design/compatible@"^1.1.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 /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-10-20T12_41_04_388Z-debug-0.log

alexsegura avatar Oct 20 '22 12:10 alexsegura

alexsegura How did you solve the problem without yarn install

wj0990 avatar Nov 19 '22 13:11 wj0990

@wj0990 I removed @ant-design/compatible because actually I didn't need it.

alexsegura avatar Nov 21 '22 11:11 alexsegura

I think this is a bug, I just use yarn install to skip the warnning

rayzang8 avatar Feb 21 '23 07:02 rayzang8

Since the code change between v1.1.0 and v.1.1.2, the peerDependencies have only changed from >=3.0.0 to 3.x on the package.json file.

@zombieJ have some issues or ideas on the v1.1.0?

andypan-twn avatar Jun 05 '23 09:06 andypan-twn

Same problem.

I just upgraded my Eslint from 6 to 8, and it needs Node 16. Everything works well. When I try to install the @ant-design/[email protected], there's a dependency error occurs:

$ npm i @ant-design/[email protected]
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/antd
npm ERR!   antd@"^4.24.16" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer antd@"3.x" from @ant-design/[email protected]
npm ERR! node_modules/@ant-design/compatible
npm ERR!   @ant-design/compatible@"1.1.2" 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/zenkiebear/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zenkiebear/.npm/_logs/2024-04-10T02_32_17_710Z-debug-0.log

ZacharyBear avatar Apr 10 '24 02:04 ZacharyBear

Anyone figure out how to fix this? I can't go to antd 5 because it breaks all my styles. I need to have antd 4.x and with this package v4 to v3 (1.1.2) i get this same peer deps issue.

chrisheseltine avatar Jun 07 '24 09:06 chrisheseltine

You need to refactor your old components to new version

ZacharyBear avatar Jun 07 '24 10:06 ZacharyBear