create-react-app 创建项目

创建react项目时报错
error [email protected]: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.8.0"
在创建项目之前执行以下命令:yarn config set ignore-engines true

引入ant-design
安装:
yarn add antd -S
在index.js 引入:
import 'antd/dist/antd.css'
页面中使用:
import { Button } from 'antd';


create-react-app 创建的 react项目,默认就是支持Sass的,使用只需要安装一下 node-sass 这个包即可使用  (使用less稍微复杂)
npm install node-sass -D



运行报错

卸载npm uninstall node-sass -D 并重新安装 npm install [email protected]

react 项目样式采用css module 
命名方式 【name】.module.css

你可能感兴趣的:(create-react-app 创建项目)