react+redux+antd+echarts+nodejs+mongodb项目搭建

脚手架以create-react-app为基准,加上redux和sass(因为我一直用的less,这次换个口味),搭建一个简单的项目。

  1. 安装依赖
    首先安装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 uninstall babel-loader 

然后安装正确的版本

npm i babel-loader@8.0.4

可能会出现再次报错的情况,可以删掉在你的项目文件夹里面的 node_modules重新安装
继续安装各种依赖
这里我暂时装了antd@3.12.1和react-redux@6.0.0
运行一下看看


因为上面是很久之前写的了,思路断掉了,先把我的package贴出来.
这是我的package.json

{
  "name": "my_react_cli",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "antd": "^3
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值