第一个React项目——使用官方脚手架create-react-app搭建第一个React项目

准备工作

1,node js环境

一、下载create-react-app

          1)使用命令行的方式进入目标文件夹(shift+右键,此处打开powershell窗口)(win10)

          2)输入命令  npx create-react-app my-app ,其中my-app 是你的项目名

          3)等待片刻,下载成功后就会显示如下界面,

第一个React项目——使用官方脚手架create-react-app搭建第一个React项目

      其实就是在你的目标文件夹下创建这个项目:

      

第一个React项目——使用官方脚手架create-react-app搭建第一个React项目

    4)命令行进入my-app 文件夹(cd my-app)

    5)启动项目 npm start

    6)成功!

    第一个React项目——使用官方脚手架create-react-app搭建第一个React项目