搭建react antd

2023-05-16

npm install -g antd

npm WARN antd@3.10.8 requires a peer of react@>=16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN antd@3.10.8 requires a peer of react-dom@>=16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ant-design/icons-react@1.1.2 requires a peer of react@16.x but none is installed. You must install peer dependencies yourself.
npm WARN create-react-context@0.2.3 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rc-editor-mention@1.1.11 requires a peer of react@>=15.x but none is installed. You must install peer dependencies yourself.
npm WARN rc-editor-mention@1.1.11 requires a peer of react-dom@>=15.x but none is installed. You must install peer dependencies yourself.
npm WARN rc-switch@1.8.0 requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rc-switch@1.8.0 requires a peer of react-dom@^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-slick@0.23.2 requires a peer of react@^0.14.0 || ^15.0.1 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-slick@0.23.2 requires a peer of react-dom@^0.14.0 || ^15.0.1 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-lazy-load@3.0.13 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-lazy-load@3.0.13 requires a peer of react-dom@^0.14.0 || ^15.0.0-0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN draft-js@0.10.5 requires a peer of react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN draft-js@0.10.5 requires a peer of react-dom@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rc-hammerjs@0.6.9 requires a peer of react@^0.14.3 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.

+ antd@3.10.8
added 115 packages in 60.12s

查看react 版本
npm info react

先安装
npm install react-native -g

npm install --save react@16.3.1
npm install -g react-dom

npm WARN react-dom@16.6.3 requires a peer of react@^16.6.3 but none is installed. You must install peer dependencies yourself.

npm install --save react@16.6.3

npm WARN react-dom@16.6.3 requires a peer of react@^16.6.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ react@16.3.1
added 7 packages and updated 1 package in 179.662s

未安装成功

引入 Can't resolve 'antd/dist/antd.css 报错
Can't resolve 'antd/lib/button' 

App.js

import React, { Component } from 'react';
import logo from './logo.svg';
import Button from 'antd/lib/button';
// import { Button } from 'antd';
import 'antd/dist/antd.css';
import './App.css';


// class App extends Component {
//   render() {
//     return (
//       <div className="App">
//         <Button type="primary">Button</Button>
//       </div>
//     );
//   }
// }



class App extends Component {
  render() {
    return (
      <div className="App">
       <div className="App">
         <Button type="primary">Button</Button>
       </div>


        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <p>
            Edit <code>src/App.js</code> and save to reload.
          </p>
          <a
            className="App-link"
            href="https://reactjs.org"
            target="_blank"
            rel="noopener noreferrer"
          >
            Learn React
          </a>
        </header>
      </div>
    );
  }
}

export default App;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

搭建react antd 的相关文章

  • 相机畸变校正详解

    转 xff1a https blog csdn net humanking7 article details 45037239 1 摄像机成像原理简述 成像的过程实质上是几个坐标系的转换 首先空间中的一点由 世界坐标系 转换到 摄像机坐标系

随机推荐

  • java错误:需要《标识符》

    出现如下错误 xff1a 上面的第一 第二 xff0c 第三个错误的原因是 xff1a 没有加函数返回值类型void 最后一个原因是 xff1a 关键字static错误 总之 xff0c 出现标识符错误 xff0c 就是说程序里的不是缺少标
  • Java的throws Exception

    转 xff1a https www cnblogs com feichengwulai articles 3793261 html 1 终极解释 xff01 xff01 xff01 throws Exception放在方法后边 xff0c
  • TX2从入门到放弃学习笔记(1)-基础

    一 资源简介 TX2作为TX1的改进版 xff0c 资源配置相当强劲 1 模组配置 256 core NVIDIA Pascal GPU ARMv8 64 bit Multi Processor CPU Complex Advanced H
  • 弹窗问题 Android Detected problems with API compatibility visit g.co/dev/appcompat for more info dialog

    原因是Android P之后Google限制了开发者调用非公开的API方法 xff0c 例如使用反射去调用SDK内部的非公开方法 xff0c 这样启动app的时候就会弹窗提示 xff0c 不过我们还是可以通过反射把他干掉 手动狗头 解决方法
  • 进程创建和替换——fork和exec

    fork fork是UNIX系统中产生新进程的唯一办法 fork的作用是复制当前进程 xff0c 生成子进程 xff0c 子进程从fork的位置继续执行 fork函数的特点概括起来就是 调用一次 xff0c 返回两次 xff0c 在父进程中
  • ROS(2)工作空间与包

    2 创建工作空间与功能包 ros的工作空间是我们开发ros项目的一个工作目录 src 代码空间 xff0c 包含代码 lanuch文件 配置文件等等 xff0c 是源码所在的目录 xff1b build 编译空间 xff0c 包含编译过程中
  • Invalid bound statement (not found)错误的可能原因

    今天在执行sql的时候遇到这个问题 xff0c 按说非常简单 xff0c 但是出现问题的原因却不是唯一的 xff0c 所以总一下 xff1a 1 检查xml文件所在package名称是否和Mapper interface所在的包名 lt m
  • 组合导航+多传感器融合算法

    1 INS GPS的组合导航系统可以输出高频率的导航参数信息 xff08 位置 速度 姿态 xff09 xff0c 并且在长 短期的导航过程中均能具备较高精度 xff08 输出数据的意义什么 xff0c PDR是步长 43 航向 xff09
  • 记录一次阿里云服务器被入侵处理经过

    本人自己的阿里云服务器 xff0c 纯个人使用 xff0c 除了提供小爱音箱开关家中esp8266灯带使用 xff0c 没什么特别的重要服务 直到有一天 xff0c 小爱平台的哥们告诉我 xff0c 我的应用响应超时 xff0c 才开始关注
  • 使用阿里云搭建自用大数据集群(3台),含计费方式描述

    1 背景 自学大数据相关课程 xff0c 需要3台虚拟机 xff0c 之前是使用本地克隆虚拟机的方式 xff0c 但是现在用mac比较多 xff0c 而且需要上班 xff0c 无法一直坐在开着虚拟机的win前进行操作学习 xff0c 所以考
  • go语言基础-gozero

    go基础 go 文档 Go语言的并发是基于 goroutine 的 xff0c goroutine 类似于线程 xff0c 但并非线程 可以将 goroutine 理解为一种虚拟线程 Go 语言运行时会参与调度 goroutine xff0
  • devops-2-prometheus

    监控对比 prometheus官方英文文档 入门教程prometheus操作指南 prometheus书学习文档 博客园prometheus系列文章 Prometheus云原生监控pdf 配套视频 服务发现 grafana告警等官方英文文档
  • 443https-公网证书nginx-freessl

    keymanage 生成证书 教程文档 freessl freessl cn acme sh帮助文档 主机记录 acme challenge 记录类型 CNAME 记录值 i7tdkyba41nr7ryod9hr dcv2 httpsaut
  • go基础语法

    基础语法 参考 log 日志 配置基础库参考 zap 日志 zap配置参考 go get u go uber org zap gin 日志 zap 生成 traceid gorm 空指针报错 传递指针地址 结果传递了值报错 reflect
  • 构建监控系统-2-zabbix开发

    参考 zabbix6官网自动发现 zabbix官网 agent监控项说明 go请求zabbix封装参考 ant design pro 前端构建 gin 官方文档 zabbix6 0接口官方文档 zabbix 各表开发介绍 zabbix we
  • 读取文件报错'utf-8' codec can't decode byte 0xb2 in position 49: invalid start byte

    python open打开文件报错 utf 8 codec can t decode byte 0xb2 in position 49 invalid start byte 解决方法 xff1a 1 操作字符为xb2 2 手动查看csv文件
  • python 技术大杂烩

    20230204 python升级报错 pip3 install span class token operator span U pip Could span class token keyword not span fetch URL
  • python 页面点击事件实现selenium

    pip install selenium coding 61 utf 8 from selenium import webdriver driver 61 webdriver Chrome driver maximize window dr
  • python 2.7 连接mysql

    sudo pip install MySQL python import xlrd import MySQLdb cursors conn 61 MySQLdb connect host 61 39 ip 39 user 61 39 use
  • 搭建react antd

    npm install g antd npm WARN antd 64 3 10 8 requires a peer of react 64 gt 61 16 0 0 but none is installed You must insta