ant-design / compatible

https://compatible.now.sh
MIT License
89 stars 23 forks source link

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

Open joexzy opened 1 year ago

joexzy commented 1 year ago

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

alexsegura commented 1 year ago

Same problem here, trying to install

$ npm update --dry-run

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: coopcycle-web@1.0.0
npm ERR! Found: antd@4.23.6
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/compatible@1.1.2
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
wj0990 commented 1 year ago

alexsegura How did you solve the problem without yarn install

alexsegura commented 1 year ago

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

rayzang8 commented 1 year ago

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

andypan-twn commented 1 year ago

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?

ZenkieBear commented 4 months ago

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/compatible@1.1.2, there's a dependency error occurs:

$ npm i @ant-design/compatible@1.1.2
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: antd@4.24.16
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/compatible@1.1.2
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
chrisheseltine commented 2 months ago

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.

ZenkieBear commented 2 months ago

You need to refactor your old components to new version