React脚手架搭建步骤
- 安装npm :
sudo apt-get install npm
- 全局安装脚手架:
sudo npm install -g create-react-app
- 切换到要使用的项目目录,创建项目:
create-react-app helloWorld
- 进入项目文件夹:
cd helloWorld
- 启动项目:
npm start
启动成功后会自动开启浏览器并访问localhost:3000
,若出现一个react标志在旋转的网页则项目启动成功。
sudo apt-get install npm
sudo npm install -g create-react-app
create-react-app helloWorld
cd helloWorld
npm start
启动成功后会自动开启浏览器并访问localhost:3000
,若出现一个react标志在旋转的网页则项目启动成功。