ant-design-icons,启动icons-react报错
git地址:https://github.com/ant-design...
在icons-react目录下执行yarn后,再运行yarn start命令,报部分文件解析不到的错误,请问是什么原因?
Module not found: Error: Can't resolve '@ant-design/icons/CheckCircleFilled' in /ant-design-icons/packages/icons-react/node_modules/antd/lib/message'
@ ./node_modules/antd/lib/message/index.js 30:48-94
@ ./node_modules/antd/lib/config-provider/index.js
@ ./node_modules/antd/lib/tooltip/index.js
@ ./examples/tooltip.tsx
@ ./.storybook/index.js
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true&quiet=true
ERROR in ./node_modules/antd/lib/notification/index.js
Module not found: Error: Can't resolve '@ant-design/icons/CheckCircleOutlined' in '/ant-design-icons/packages/icons-react/node_modules/antd/lib/notification'
@ ./node_modules/antd/lib/notification/index.js 26:50-98
@ ./node_modules/antd/lib/config-provider/index.js
@ ./node_modules/antd/lib/tooltip/index.js
@ ./examples/tooltip.tsx
@ ./.storybook/index.js
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true&quiet=true
ERROR in ./node_modules/antd/lib/message/index.js
Module not found: Error: Can't resolve '@ant-design/icons/CloseCircleFilled' in '/ant-design-icons/packages/icons-react/node_modules/antd/lib/message'
@ ./node_modules/antd/lib/message/index.js 28:48-94
@ ./node_modules/antd/lib/config-provider/index.js
@ ./node_modules/antd/lib/tooltip/index.js
@ ./examples/tooltip.tsx
@ ./.storybook/index.js
@ ./.storybook/config.js
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true&quiet=true
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
antd版本不兼容导致的。它package.json里安装的antd是4.8.2的,但它的father安装的是3.19.2的,所以只需要把package.json里这一行改成3.19.2就可以了:
重新yarn安装一下,然后yarn start就可以了。