【React + Antd 教程】Failed to compile. Module not found: Can’t resolve 'antd/dist’完美解决
今天在学习React + Antd时
出了个不能编译的报错
Failed to compile.
./src/App.js
Module not found: Can't resolve 'antd/dist' in 'G:\***\src'


我是跟着视频敲得代码啊
怎么我这里就出错了呢 ? ? ?

于是
我在网上找寻各种解决办法
无 果
还得靠自己解决
首先
这个“Module not found: Can’t resolve ‘antd/dist’”报错的意思是:
'antd/dist’这个模块没有找到
于是我就查看该目录

这不是有这个模块吗? ? ? ? ? ?


然后
我想是不是不能直接导入这个包
导入整个包是不是就不能编译
所以是不是这里的问题呢?
于是
我更改导入为

本文介绍了在学习React + Antd过程中遇到的`Failed to compile. Module not found: Can't resolve 'antd/dist'`错误,分析了错误原因,并分享了解决此问题的具体步骤,通过更改导入路径成功编译并通过运行。
最低0.47元/天 解锁文章
576

被折叠的 条评论
为什么被折叠?



