1.全局安装 create-react-app
npm install -g create-react-app 全局安装
create-react-app reactdemo 新建并对react项目进行命名(注:项目名称不能有大写)
或者
npx create-react-app reactdemo 新建并对react项目进行命名(注:项目名称不能有大写)
2.如果想搭建基于ts的项目,只需要在命令后面添加--template typescript就可以了
create-react-app my-app-ts --template typescript
或者
npx create-react-app my-app-ts --template typescript
评论区