脚手架以create-react-app为基准,加上redux和sass(因为我一直用的less,这次换个口味),搭建一个简单的项目。
- 安装依赖
首先安装create-react-app
npm i create-react-app
给项目起个名字
create-react-app my_react_cli(项目名)
啪嗒回车,开始安装项目,此过程会持续几分钟,可以去干点别的~
运行一下看看,有没有问题
npm start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"babel-loader": "8.0.4"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-loader was detected higher up in the tree:
C:\Users\liu\node_modules\babel-loader (version: 7.1.5)
因为文主之前搭建别的项目时安装了babel-loader,导致的版本不对,那就卸掉babel-loader,按照所需的8.0.4版本安装一下
卸载babel-loader
npm

本文档描述了如何基于create-react-app搭建一个包含Redux、Sass、Echarts、Node.js和MongoDB的项目。首先安装create-react-app并创建项目,解决可能的依赖冲突。接着安装antd、react-redux等库,并配置axios进行API请求。然后,设置路由以实现页面跳转。同时,介绍了MongoDB的安装和Robo 3T作为可视化工具的使用,以及数据库的创建流程。这是一个逐步展开的项目构建过程。
最低0.47元/天 解锁文章
882

被折叠的 条评论
为什么被折叠?



