react脚手架工具
- npm install create-react-app -g 安装脚手架
- create-react-app -V 查看脚手架版本号
- create-react-app 项目名字 通过脚手架工具创建一个项目
- npx cache clean --force 清理缓存
- 注意:部分插件版本依赖问题 需要先打开旺旺大礼包
- npm run eject 解开插件包(打开之前需要提交一次本地仓库提交)
- npm run build 编译打包
- npm start 打开项目可以看到实例
创建脚手架出错解决 (环境变量)
这个错误 spawn cmd ENOENT
需要配置cmd 路径 把 cmd 的默认路径添加到path 配置里面 部分电脑添加完后面需要加分号
基本命令
- npm start 本地开发环境运行
- npm run eject 解开插件包
- npm run build 编译打包