当前位置: 代码网 > it编程>前端脚本>Vue.js > vue-cli自定义创建项目-eslint依赖冲突解决方式

vue-cli自定义创建项目-eslint依赖冲突解决方式

2024年08月03日 Vue.js 我要评论
vue-cli

创建项目步骤
在这里插入图片描述
概览:
在这里插入图片描述
在安装 npm安装时会报错

npm err! code eresolve
npm err! eresolve could not resolve
npm err!
npm err! while resolving: @vue/eslint-config-standard@6.1.0
npm err! found: eslint-plugin-vue@8.7.1
npm err! node_modules/eslint-plugin-vue
npm err!   dev eslint-plugin-vue@"^8.0.3" from the root project
npm err!
npm err! could not resolve dependency:
npm err! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm err! node_modules/@vue/eslint-config-standard
npm err!   dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm err!
npm err! conflicting peer dependency: eslint-plugin-vue@7.20.0
npm err! node_modules/eslint-plugin-vue
npm err!   peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm err!   node_modules/@vue/eslint-config-standard
npm err!     dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm err!
npm err! fix the upstream dependency conflict, or retry
npm err! this command with --force or --legacy-peer-deps
npm err! to accept an incorrect (and potentially broken) dependency resolution.

依赖冲突原因:
@vue/eslint-config-standard@6.1.0 依赖于 eslint-plugin-vue 的 ^7.0.0 版本,但是项目中安装了更高版本的eslint-plugin-vue
在这里插入图片描述
解决方式:降级eslint-plugin-vue到@vue/eslint-config-standard支持的版本

npm install eslint-plugin-vue@^7.0.0

解决后:
在这里插入图片描述
再进行npm安装,就能成功

npm i --registry https://registry.npmmirror.com vant@latest-v2 -s

在这里插入图片描述

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com