创建第一个React应用(create-react-app脚手架)

通过命令确定node和npm的是否是相对较新的版本

node --version
npm --version

安装脚手架工具create-react-app,需要全局安装

npm install create-react-app -g

使用命令创建demo(需要提前进入到项目保存的目录中)

create-react-app demo

命令执行后,会生成以下目录:

在终端进入demo目录下执行npm start,就打开了默认为http://localhost:3000/ 页面

猜你喜欢

转载自blog.csdn.net/u010899138/article/details/90267210