https://blog.csdn.net/shuaishuai1234/article/details/82790049?tdsourcetag=s_pctim_aiomsg
1.安装了nodejs,并使用命令行输入 node -v 和 npm -v 来查看版本号以确认安装成功。
2.安装淘宝镜像cnmp
由于npm 安装太慢 所以使用cnmp。
一、脚手架工具create-react-app安装
使用以下命令进行安装:
npm install -g create-react-app
二、create-react-app的使用
- 在需要创建项目的位置打开命令行
- 输入create-react-app + 项目名称的命令,比如:
create-react-app my-app
3.当项目创建完成后,可以进入项目,并启动:
cd my-app
npm start
三、脚手架工具生成的目录结构
(react的安装与使用 - 简书 https://www.jianshu.com/p/1f3acf8f8927 )
重要文件:
index.html
index.js
App.js