当前位置: 首页 > news >正文

安装ant design pro V6相关依赖和react版本冲突报错,umi和node版本冲突

ant design pro V6最新版,选择的是simple版本,install时报错如下:

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @antv/l7-react@2.4.3
npm error Found: react@18.3.1
npm error node_modules/react
npm error   react@"^18.2.0" from the root project
npm error   peer react@">=16.9.0" from antd@5.24.2
npm error   node_modules/antd
npm error     antd@"^5.12.7" from the root project
npm error     peer antd@">=5.8.1" from antd-style@3.7.1
npm error     node_modules/antd-style
npm error       antd-style@"^3.6.1" from the root project
npm error     11 more (@ant-design/pro-card, @ant-design/pro-components, ...)
npm error   144 more (rc-dialog, rc-dropdown, rc-select, rc-textarea, ...)
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.8.6 || ^17.0.2" from @antv/l7-react@2.4.3
npm error node_modules/@antv/l7-react
npm error   @antv/l7-react@"^2.4.3" from the root project
npm error
npm error Conflicting peer dependency: react@17.0.2
npm error node_modules/react
npm error   peer react@"^16.8.6 || ^17.0.2" from @antv/l7-react@2.4.3
npm error   node_modules/@antv/l7-react
npm error     @antv/l7-react@"^2.4.3" from the root project

想要无痛无坑,直接将卸载node或版本降到20.20.1,然后安装yarn,用yarn install安装依赖直接解决问题,不要相信哪些--force,或者--legacy-peer-deps,因为后面还会报各种错,如下umi:

>yarn install或者npm install --force
npm warn deprecated @stylelint/postcss-css-in-js@0.37.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.> ant-design-pro@6.0.0 postinstall
> max setupfatal - Error: Register plugin E:/xxx/xxx/myapp/node_modules/@umijs/preset-umi/dist/features/esmi/esmi.js failed, since No such module: http_parserat Plugin.apply (E:\xxx\xxx\myapp\node_modules\@umijs\core\dist\service\plugin.js:76:15)at Service.initPlugin (E:\xxx\xxx\myapp\node_modules\@umijs\core\dist\service\service.js:463:33)at Service.run (E:\xxx\xxx\myapp\node_modules\@umijs\core\dist\service\service.js:259:18)at process.processTicksAndRejections (node:internal/process/task_queues:104:5)at async Service.run2 (E:\xxx\xxx\myapp\node_modules\umi\dist\service\service.js:65:12)at async run (E:\xxx\xxx\myapp\node_modules\umi\dist\cli\cli.js:56:7) {[cause]: Error: No such module: http_parserat process.binding (node:internal/bootstrap/realm:162:11)at Object.<anonymous> (E:\xxx\xxx\myapp\node_modules\http-deceiver\lib\deceiver.js:22:24)at Module._compile (node:internal/modules/cjs/loader:1812:14)at Object..js (node:internal/modules/cjs/loader:1943:10)at Module.load (node:internal/modules/cjs/loader:1533:32)at Module._load (node:internal/modules/cjs/loader:1335:12)at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)at Module.require (node:internal/modules/cjs/loader:1556:12)at require (node:internal/modules/helpers:152:16)at Object.<anonymous> (E:\xxx\xxx\myapp\node_modules\spdy\lib\spdy\handle.js:5:20)
}
fatal - A complete log of this run can be found in:
fatal - E:\xxx\xxx\myapp\node_modules\.cache\logger\umi.log
fatal - Consider reporting a GitHub issue on https://github.com/umijs/umi/issues
npm error code 1
npm error path E:\xxx\xxx\myapp
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c max setup
npm error A complete log of this run can be found in: C:\Users\xxx\AppData\Local\npm-cache\_logs\2026-03-15T06_24_02_824Z-debug-0.log

省心点直接重装。

成功图:执行yarn install命令:

image

image

笔者运行界面出来了,但是还有一点小报错:

npm run dev
Active code page: 65001> ant-design-pro@6.0.0 dev
> npm run start:dev> ant-design-pro@6.0.0 start:dev
> cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev😄 Hello PRO
info  - [你知道吗?] father 4 正式发布了,详见 https://zhuanlan.zhihu.com/p/558192063
Using openapi Plugin
info  - Umi v4.6.33
info  - Preparing...╔════════════════════════════════════════════════════╗║ App listening at:                                  ║║  >   Local: http://localhost:8000                  ║
ready - ║  > Network: http://169.254.217.49:8000             ║║                                                    ║║ Now you can open browser with the above addresses↑ ║╚════════════════════════════════════════════════════╝
Browserslist: caniuse-lite is outdated. Please run:npx update-browserslist-db@latestWhy you should do it regularly: https://github.com/browserslist/update-db#readme
event - [Webpack] Compiled in 10405 ms (648 modules)
info  - [MFSU] buildDeps since cacheDependency has changed
wait  - [Webpack] Compiling...
fetch openapi error: FetchError: request to http://localhost:7529/api/doc.html failed, reason: at ClientRequest.<anonymous> (E:\xxx\xxx\myapp\node_modules\node-fetch\lib\index.js:1501:11)at ClientRequest.emit (node:events:524:28)at emitErrorEvent (node:_http_client:101:11)at Socket.socketErrorListener (node:_http_client:504:5)at Socket.emit (node:events:524:28)at emitErrorNT (node:internal/streams/destroy:169:8)at emitErrorCloseNT (node:internal/streams/destroy:128:3)at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {type: 'system',errno: 'ECONNREFUSED',code: 'ECONNREFUSED'
}
event - [Webpack] Compiled in 483 ms (622 modules)
wait  - [Webpack] Compiling...
fetch openapi error: FetchError: request to http://localhost:7529/api/doc.html failed, reason: at ClientRequest.<anonymous> (E:\xxx\xxx\myapp\node_modules\node-fetch\lib\index.js:1501:11)at ClientRequest.emit (node:events:524:28)at emitErrorEvent (node:_http_client:101:11)at Socket.socketErrorListener (node:_http_client:504:5)at Socket.emit (node:events:524:28)at emitErrorNT (node:internal/streams/destroy:169:8)at emitErrorCloseNT (node:internal/streams/destroy:128:3)at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {type: 'system',errno: 'ECONNREFUSED',code: 'ECONNREFUSED'
}
event - [Webpack] Compiled in 356 ms (622 modules)
fetch openapi error: FetchError: request to http://localhost:7529/api/doc.html failed, reason: at ClientRequest.<anonymous> (E:\xxx\xxx\myapp\node_modules\node-fetch\lib\index.js:1501:11)at ClientRequest.emit (node:events:524:28)at emitErrorEvent (node:_http_client:101:11)at Socket.socketErrorListener (node:_http_client:504:5)at Socket.emit (node:events:524:28)at emitErrorNT (node:internal/streams/destroy:169:8)at emitErrorCloseNT (node:internal/streams/destroy:128:3)at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {type: 'system',errno: 'ECONNREFUSED',code: 'ECONNREFUSED'
}
event - [Webpack] Compiled in 73833 ms (12844 modules)

image

http://www.jsqmd.com/news/481771/

相关文章:

  • 5本自学大模型的入门书籍,从入门到精通,都在这里了!
  • TCP close 过程分析 - liyan
  • 用实力说话千笔,多场景适配降重神器 —— 千笔
  • AReaL: A Large-Scale Asynchronous Reinforcement Learning System for Language Reasoning
  • bpftrace 无侵入遍历golang链表 - liyan
  • 恒企专修学院电话查询:选择培训机构的风险提示 - 品牌推荐
  • 导师推荐 8个降AIGC工具:多场景适配+降AI率全测评
  • 大模型开发入门到进阶:从入门到实战,4阶段完整路径,带你掌握大模型开发!
  • 30天硬核!从0到精通大模型开发,高薪风口等你来抓!
  • 毕业论文神器 9个AI论文网站深度测评:本科生开题报告与学术写作必备工具
  • bpftrace 遍历 golang 链表(go17+) - liyan
  • c++插件管理--pluma实践 - liyan
  • 四周速成!从零掌握AI大模型,内含实战项目与学习计划_30天大模型开发速成
  • 09 部署与成本控制:Serverless 架构下 Agent 的 Token 优化艺术
  • 老王-城府不是心机而是清醒的边界感
  • BPF 获取 LVS FullNat 模式下的 Client IP - liyan
  • 解决RDK X5(ARM64架构)板卡Remote-SSH运行Antigravity AI崩溃(SIGILL):Samba网络盘本地挂载方案
  • 强烈安利! AI论文工具,千笔AI VS 灵感风暴AI,专科生必备神器!
  • centos 安装docker并构建golang镜像 - liyan
  • 狡猾的北狐狸
  • 老王-三观稳则人生稳
  • centos 构建 local-k8s - liyan
  • 老王-老祖宗没说完的后半句
  • 2026涂塑钢管市场评测:哪些公司口碑较好?IPN8710防腐钢管/圆孔滤水钢管 ,涂塑钢管制造厂家推荐排行榜单 - 品牌推荐师
  • 老王-缺心眼是边界感缺失
  • clisp编译 - liyan
  • 老王-家兴不在运在德
  • challenges of bpf tracing go - liyan
  • 泛型体系实战
  • 电机设计仿真:Maxwell ANSYS 五相电机设计