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

因为路径大小写问题重新安装ant design pro的依赖

File name 'e:/java/xxx/myapp/node_modules/@ant-design/pro-components/es/index.d.ts' differs from already included file name 'e:/java/xxx/myapp/node_modules/@ant-design/pro-components/es/index.d.ts' only in casing.The file is in the program because:Type library referenced via 'E:/java/xxx/myapp/node_modules/@ant-design/pro-components' from file 'E:/java/xxx/myapp/src/.umi/plugin-layout/types.d.ts' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/components/Footer/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via "E:/java/xxx/myapp/node_modules/@ant-design/pro-components" from file 'E:/java/xxx/myapp/src/.umi/plugin-layout/types.d.ts' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/app.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/app.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/config/defaultSettings.ts' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/config/defaultSettings.ts' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/components/Footer/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/app.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/app.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/Admin.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/Welcome.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/add_chart/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/table-list/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/table-list/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/table-list/components/CreateForm.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/table-list/components/UpdateForm.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'Imported via '@ant-design/pro-components' from file 'e:/java/xxx/myapp/src/pages/user/login/index.tsx' with packageId '@ant-design/pro-components/es/index.d.ts@2.8.10'ts(1149)
types.d.ts(3, 23): File is included via type library reference here.
index.tsx(2, 31): File is included via import here.
types.d.ts(6, 54): File is included via import here.
app.tsx(2, 49): File is included via import here.
app.tsx(3, 31): File is included via import here.
defaultSettings.ts(1, 37): File is included via import here.
defaultSettings.ts(1, 37): File is included via import here.
index.tsx(2, 31): File is included via import here.
app.tsx(2, 49): File is included via import here.
app.tsx(3, 31): File is included via import here.
Admin.tsx(2, 31): File is included via import here.
Welcome.tsx(1, 31): File is included via import here.
index.tsx(5, 8): File is included via import here.
index.tsx(11, 8): File is included via import here.
CreateForm.tsx(7, 8): File is included via import here.
UpdateForm.tsx(8, 8): File is included via import here.
index.tsx(14, 8): File is included via import here.

报错原因,因为xxx这里有段路径有字母大写,导致报错。项目之前运行很久没有任何问题,今天安装Echarts的时候安装不上,然后刷新项目缓存后,全部飘红,@ant design和@antd等组件轮流报错,怎么个轮流法,现在不是大写的吗,我改成小写重新进入项目,@antd报错说原来路径是大写的,现在发现路径小写了,错了——找不到路径,改回去@ant design还是报错。这框架是真难用,下次我用已经报废的饿了么,无奈~

步骤:

方案一:

删除node_module和package-lock.json

再命令安装:yarn install,不知道能不能搞定。

方案一失败,引入新的问题,echarts安装成功,import { ProCard, ProFormUploadButton } from '@ant-design/pro-components';@antd的问题解决了,但有以下报错四种报错(方案二中)。

 

方案二:

import { createStyles } from 'antd-style';报错没有createStyle
const useStyles = createStyles(({ token }) => {})这个也报错 说没有token 
 

onFinish={async (values) => {
  await handleSubmit(values as API.LoginParams);
}}

上面这个也onFinish也报错,(values: any),加上类型就不报错。

 

import type { DropDownProps } from 'antd/es/dropdown';这个也报错,说没有,将路径重新写一次恢复了?

 

createStyle的问题,用重启TS服务器搞定的:

  1. 按 Ctrl+Shift+P

  2. 输入并选择:TypeScript: Restart TS server

 

好了又能开发了,不知道下次什么时候报错,真不稳定。

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

相关文章:

  • 为什么Apollo、Autoware都爱用Frenet坐标系?从道路中心线理解路径规划
  • 突破性AI革命:AMD显卡用户如何轻松驾驭本地大语言模型?
  • 如何在Linux和Windows上免费获取完整的macOS光标体验
  • Python 3.14 JIT性能跃迁实战手册(2026 Q1基准测试全披露):从28ms到9.2ms的确定性低延迟改造路径
  • 2026年AI前20岗位薪酬出炉!搞AI大模型的远超同行?
  • 面向对象与多源数据融合:基于eCognition-ENVI的雄安新区城市扩张动态监测
  • OpenClaw+nanobot:个人知识管理助手从搭建到实战
  • SDMatte GPU故障排查手册:CUDA版本冲突/OOM错误/驱动不兼容处理
  • 抖音无水印下载器:5分钟掌握高效批量下载技巧
  • ChangeTracker:嵌入式信号变化检测轻量库
  • 系统焕新:Win11Debloat工具让Windows性能提升51%的全方位优化方案
  • 从Shadertoy到Cesium:那些GLSL移植时没人告诉你的分辨率陷阱
  • 零基础玩转DeepSeek-OCR-2:手把手教你用Docker快速部署文档识别服务
  • websocket-client与websockets:同步与异步的实战选择指南
  • 深入OpenBMC构建系统:Yocto项目与BitBake实战解析(以Romulus平台为例)
  • 如何使用Mi-Create打造个性化智能穿戴表盘:全面技术指南
  • 图像超分新思路:拆解SCNet的‘空间移位’操作,看它如何用零参数实现3x3卷积的效果
  • 5步精通抖音批量下载工具:从零基础到高效管理视频资源的完整指南
  • Claude Code 用了半年才发现,原来上下文烧没了自己根本不知道!
  • s2-pro开源大模型详解:参数调优+音色复用+格式导出完整指南
  • UE5场景过曝/白屏排查指南:从后期处理体积到项目设置的实战修复
  • 给嵌入式新手的保姆级指南:JTAG、SWD、J-Link、ST-Link到底怎么选?
  • Qt vs wxWidgets vs FLTK:C++跨平台GUI框架实战选型指南
  • OpenClaw 全面解析:Token时代的iPhone如何颠覆开发者工作流?
  • 2026最权威一键生成论文工具榜单:这些被高校和导师悄悄推荐的软件你用了吗
  • 5分钟搞定OpenClaw+GLM-4.7-Flash:星图平台一键部署体验
  • 【游戏技术】SourceMod 插件开发与实战应用指南
  • AI 大模型落地系列|Eino 组件核心篇:Indexer 背后,真正值得看懂的是 Store
  • KMP实战:从Android到iOS的无缝迁移指南
  • YOLOv11分割模型实战:用C++和ONNXRuntime解析‘output0’和‘output1’双输出,实现像素级颜色分析