1.全局安装create-react-app

npm install -g create-react-app

create-react-app搭建react项目

2.创建项目

create-react-app 项目文件夹名

create-react-app搭建react项目

3.进入项目

3.1 cd 项目文件夹名

create-react-app搭建react项目

创建之后的项目目录

create-react-app搭建react项目

3.2运行项目

npm start 

create-react-app搭建react项目

打开http://localhost:3000/查看运行成功后的项目

create-react-app搭建react项目

相关文章: