使用react脚手架创建项目
一、首先需要安装node.js
具体如何安装参考网址:https://www.jianshu.com/p/0ddecdbb4048
![](http://upload-images.jianshu.io/upload_images/11967024-88c3b689aa834994.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200/format/webp)
下载安装包
双击打开安装文件
![](http://upload-images.jianshu.io/upload_images/11967024-a9bd127a98d80704.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
setup
点击next,下一步
![](http://upload-images.jianshu.io/upload_images/11967024-628783ca4d5670bf.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
勾选
选中勾选框,点击next,下一步
![](http://upload-images.jianshu.io/upload_images/11967024-9443fa66ac9ab8f0.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
安装路径
选择安装路径,默认路径即可,点击next,下一步
![](http://upload-images.jianshu.io/upload_images/11967024-fb4d0961a276ebef.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
安装配置
默认即可,点击next,下一步
![](http://upload-images.jianshu.io/upload_images/11967024-dc80c02a409c3939.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
安装开始
点击install,开始等待安装
![](http://upload-images.jianshu.io/upload_images/11967024-a1480b23799d2fac.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
安装中
点击finish,安装完成
![](http://upload-images.jianshu.io/upload_images/11967024-957d7714e65e58cc.png?imageMogr2/auto-orient/strip|imageView2/2/w/499/format/webp)
finish
打开命令提示符窗口,输入 node -v验证安装
![](http://upload-images.jianshu.io/upload_images/11967024-60de75e1c714f2ec.png?imageMogr2/auto-orient/strip|imageView2/2/w/677/format/webp)
查看node安装版本
二、全局安装create-react-app;
打开命令框
![](https://img2018.cnblogs.com/common/1894955/202002/1894955-20200203173541311-34441133.png)
安装命令 npm install -g create-react-app +回车
![](https://img2018.cnblogs.com/common/1894955/202002/1894955-20200203173700230-1193574961.png)
三、创建项目
在要创建项目的目录下打开命令行
在命令行中使用 create-react-app 项目名 +回车![](https://img2018.cnblogs.com/common/1894955/202002/1894955-20200203174057953-42583522.png)
![](https://img2018.cnblogs.com/common/1894955/202002/1894955-20200203174057953-42583522.png)
然后在ToDoList 文件目录下打开命令行 输入npm start +回车 项目就可以运行了