Directly use the yarn add antd command to install, and the latest version 5.0.0 is installed by default
Introduce in App.css according to the official website
report error
Observe the import path, go to node_modules to find
Found that there are no css related files in antd/dist, only js related files
Solution
Uninstall the previous antd
yarn remove antd
Try to lower the version, yarn specifies the version number
yarn add antd@^4.24.2
The installation is successful, check node_modules, now everything is complete
Introduce according to the official website
problem solved