首页 > 其他分享 >ant design pro移除国际化报错解决步骤

ant design pro移除国际化报错解决步骤

时间:2023-12-31 14:57:43浏览次数:35  
标签:pro ant design prettier 移除 path 报错 eslint

一、环境
ant-design-pro版本:6.0.0
npm 版本:8.1.0
node 版本:v16.13.0
二、开步骤
1、点击移除按钮
image
2、报错误" Failed to load config "prettier" to extend from."
image
3、使用命令"npm i --save-dev prettier eslint-config-prettier eslint-plugin-prettier"(参考github官方issues:https://github.com/ant-design/ant-design-pro/issues/10497)
image
4、使用命令安装包错误,这个错误意味着npm在尝试安装这些包时遇到了依赖冲突。具体来说,[email protected]需要一个prettier版本>=3.0.0,但项目中已安装的prettier版本是2.8.8。由于[email protected]尚未发布,安装失败。
image
5、改成命令“npm i --save-dev [email protected] eslint-config-prettier [email protected]
image
6、再次执行移除国际化命令,报错误" Environment key "es2022" is unknown"
image
7、issue解决方案:https://github.com/ant-design/ant-design-pro/issues/10452
image
image
8、再次运行移除国际化命令,此时又报错误"Cannot find module 'eslint-plugin-unicorn'"
image
9、issue解决方案:https://github.com/ant-design/ant-design-pro/issues/10452
image
10、此时我们运行命令"npm add eslint-config-prettier --dev yarn add eslint-plugin-unicorn --dev "
image
11、此时我们再次运行移除国际化命令,没有报错,此时运行项目,发现已经没有切换语言的选项了,但是左侧没有目录了。image
12、原来的路由没有name属性所以看不见菜单栏,这里我们使用下面的代码替换路由文件,并且使用admin账号登录。
image

export default [
{ name: '登录', path: '/user', layout: false, routes: [{ path: '/user/login', component: './User/Login' }] },
{ name: '欢迎页面', path: '/welcome', icon: 'smile', component: './Welcome' },
{
path: '/admin',
icon: 'crown',
access: 'canAdmin',
name: '管理员页面',
routes: [
{ path: '/admin', redirect: '/admin/sub-page' },
{ path: '/admin/sub-page', component: './Admin' },
],
},
{ icon: 'table', path: '/list', component: './TableList', name: '表格页' },
{ path: '/', redirect: '/welcome' },
{ path: '*', layout: false, component: './404' },
];
image
13、最后,我们将locals目录删除
image

标签:pro,ant,design,prettier,移除,path,报错,eslint
From: https://www.cnblogs.com/senior-shef/p/17937466

相关文章

  • Python Machine Learning Projects: Building RealWorld Applications
    1.背景介绍人工智能和机器学习技术在过去的几年里取得了巨大的进步,这使得许多实际应用成为可能。这本书《16.PythonMachineLearningProjects:BuildingReal-WorldApplications》旨在帮助读者理解这些实际应用,并提供有关如何使用Python编写机器学习代码的实践指南。本书的目......
  • Keras and Transfer Learning: Harnessing PreTrained Models for Your Projects
    1.背景介绍Keras是一个开源的深度学习框架,由Google的TensorFlow团队开发。它提供了许多预训练的模型,可以用于各种项目。在这篇文章中,我们将讨论Keras和传输学习的基本概念,以及如何利用预训练模型来完成自己的项目。传输学习是一种机器学习方法,它涉及到在一种任务上训练的模......
  • CF1916D Mathematical Problem
    思路很不错的人类智慧题。拿到以后,完全没有思路,看到数据范围,感觉是什么\(n^2\logn\)的逆天做法,但是又完全没思路,看后面的题感觉没希望,就在这道题死磕。先打了个暴力程序,发现平方数太多,没什么规律,就拿了个map统计一下那些出现数字方案拥有的平方数比较多程序如下:#include......
  • day03 代码随想录算法训练营 203. 移除链表元素
    题目:203.移除链表元素我的感悟:题目里的节点是已经给好的,创建虚拟节点,是为了方便处理头节点。加油,我可以的!!!!!理解难点:节点已经给好的创建虚拟节点代码难点:p是临时变量,类似于foriinrange(10)这里的i,本身是用完就扔的。返回值为什么不能是p.next?因为p是一个指针,......
  • appium报错DeprecationWarning: desired_capabilities argument is deprecated and wi
    不再用desired_capabilities,用options代替原来的desired_caps={"platformName":"ios","platformVersion":"11.4","deviceName":"iPhone6Plus",&......
  • fsproj 相关 net481
    net481是.netframework4.8.1的标识名称,F#xunit默认下拉列表目标没有包含它,如果你必须测试net481,对于项目文件作如下修改:<PropertyGroup><!--<TargetFramework>net6.0</TargetFramework>--><TargetFramework>net481</TargetFramework></PropertyGroup......
  • 一个报错深刻理解axios传参和mock拦截(外加正则表达式)
    前言:事情是这样的,在使用axios二次封装和mock进行拦截的时候,不是参数传递方式不正确就是找不到后端接口,为此我茶不思饭不想把axios和mock好好看了一遍,最后除了这些问题,发现是输在了正则表达式上面,找出错误的时候自己都懵了axioa传参问题总所周知,我们在平时使用axios的时候是这样......
  • ProjectorMultiply.Shader 非固定管线版本
    //UpgradeNOTE:replaced'_Projector'with'unity_Projector'//UpgradeNOTE:replaced'_ProjectorClip'with'unity_ProjectorClip'Shader"Projector/Multiply"{Properties{_ShadowTex("......
  • Prometheus搭建教程
    一、部署prometheus官方文档:https://prometheus.io/docs/introduction/first_steps/下载地址:https://github.com/prometheus/prometheus/releases[root@centos7~]#tarzxfprometheus-2.45.2.linux-amd64.tar.gz[root@centos7~]#mvprometheus-2.45.2.linux-amd64/usr/l......
  • Provider 四种消费者
    Provider.ofProvider.of方法是Provider库中最常用的获取共享数据的方法之一。它接收一个BuildContext对象和一个泛型类型参数T,会查找Widget树中最近的一个类型为T的Provider对象,并返回它所提供的共享数据。当共享数据发生变化时,它会自动重新构建与该共享数据有依赖关......