npm install报错peerDependencies WARNING eslint-plugin-vue@^5.2.3 requires a peer of eslint@^5.0.0 but

本文详细记录了解决eslint版本不兼容导致的npm安装错误的过程。通过调整eslint及其相关插件的版本,成功解决了peerDependencies警告和deprecate警告,确保了项目的正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、问题场景:

npm install 报错,以为是npm问题,改成cnpm install,也还是报错,根据错误信息提示,推断是eslint版本不兼容。

报错提示:

peerDependencies WARNING eslint-plugin-vue@^5.2.3 requires a peer of eslint@^5.0.0 but eslint@6.8.0 was installed
peerDependencies WARNING eslint-plugin-vue@5.2.3 › vue-eslint-parser@^5.0.0 requires a peer of eslint@^5.0.0 but eslint@6.8.0 was installed
peerDependencies WARNING eslint-config-standard@^14.1.0 requires a peer of eslint-plugin-node@>=9.1.0 but eslint-plugin-node@8.0.1 was installed
deprecate @vue/cli-plugin-babel@3.5.1 › @vue/babel-preset-app@3.12.1 › core-js@^2.6.5 core-js@<3 is no longer maintained and not recommended for usage
 due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
deprecate @vue/cli-plugin-eslint@3.12.1 › eslint@4.19.1 › file-entry-cache@2.0.0 › flat-cache@1.3.4 › circular-json@^0.3.1 CircularJSON is in maintena
nce only, flatted is its successor.

2、解决办法

安装固定版本npm i  eslint@5.0.0

PS D:\My JAVA\苍穹外卖\前端源码\苍穹外卖前端源码\project-sky-admin-vue-ts> npm install npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @typescript-eslint/eslint-plugin@1.13.0 npm WARN Found: eslint@6.7.2 npm WARN node_modules/eslint npm WARN dev eslint@"^6.2.2" from the root project npm WARN 10 more (@typescript-eslint/experimental-utils, babel-eslint, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@"^5.0.0" from @typescript-eslint/eslint-plugin@1.13.0 npm WARN node_modules/@typescript-eslint/eslint-plugin npm WARN @typescript-eslint/eslint-plugin@"^1.1.0" from @vue/eslint-config-typescript@4.0.0 npm WARN node_modules/@vue/eslint-config-typescript npm WARN npm WARN Conflicting peer dependency: eslint@5.16.0 npm WARN node_modules/eslint npm WARN peer eslint@"^5.0.0" from @typescript-eslint/eslint-plugin@1.13.0 npm WARN node_modules/@typescript-eslint/eslint-plugin npm WARN @typescript-eslint/eslint-plugin@"^1.1.0" from @vue/eslint-config-typescript@4.0.0 npm WARN node_modules/@vue/eslint-config-typescript npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @typescript-eslint/parser@1.13.0 npm WARN Found: eslint@6.7.2 npm WARN node_modules/eslint npm WARN dev eslint@"^6.2.2" from the root project npm WARN 10 more (@typescript-eslint/experimental-utils, babel-eslint, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer eslint@"^5.0.0" from @typescript-eslint/parser@1.13.0 npm WARN node_modules/@typescript-eslint/parser npm WARN peer @typescript-eslint/parser@"^1.9.0" from @typescript-eslint/eslint-plugin@1.13.0 npm WARN node_modules/@typescript-eslint/eslint-plugin npm WARN 1 more (@vue/eslint-config-typescript) npm WARN npm WARN Conflicting peer dependency: eslint@5.16.0 npm WARN node_modules/eslint npm WARN peer eslint@"^5.0.0" from @typescript-eslint/parser@1.13.0 npm WARN node_modules/@typescript-eslint/parser npm WARN peer @typescript-eslint/parser@"^1.9.0" from @typescript-eslint/eslint-plugin@1.13.0 npm WARN node_modules/@typescript-eslint/eslint-plugin npm WARN 1 more (@vue/eslint-config-typescript) npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: eslint-plugin-vue@5.2.3 npm ERR! Found: eslint@6.7.2 npm ERR! node_modules/eslint npm ERR! dev eslint@"^6.2.2" from the root project npm ERR! peer eslint@"*" from @typescript-eslint/experimental-utils@1.13.0 npm ERR! node_modules/@typescript-eslint/experimental-utils npm ERR! @typescript-eslint/experimental-utils@"1.13.0" from @typescript-eslint/eslint-plugin@1.13.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! @typescript-eslint/eslint-plugin@"^1.1.0" from @vue/eslint-config-typescript@4.0.0 npm ERR! node_modules/@vue/eslint-config-typescript npm ERR! dev @vue/eslint-config-typescript@"^4.0.0" from the root project npm ERR! @typescript-eslint/experimental-utils@"1.13.0" from @typescript-eslint/parser@1.13.0 npm ERR! node_modules/@typescript-eslint/parser npm ERR! peer @typescript-eslint/parser@"^1.9.0" from @typescript-eslint/eslint-plugin@1.13.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! @typescript-eslint/eslint-plugin@"^1.1.0" from @vue/eslint-config-typescript@4.0.0 npm ERR! node_modules/@vue/eslint-config-typescript npm ERR! 1 more (@vue/eslint-config-typescript) npm ERR! 9 more (babel-eslint, eslint-config-standard, eslint-loader, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer eslint@"^5.0.0" from eslint-plugin-vue@5.2.3 npm ERR! node_modules/eslint-plugin-vue npm ERR! dev eslint-plugin-vue@"^5.2.3" from the root project npm ERR! npm ERR! Conflicting peer dependency: eslint@5.16.0 npm ERR! node_modules/eslint npm ERR! peer eslint@"^5.0.0" from eslint-plugin-vue@5.2.3 npm ERR! node_modules/eslint-plugin-vue npm ERR! dev eslint-plugin-vue@"^5.2.3" 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. npm ERR! npm ERR! See C:\Users\liuchaokun\AppData\Local\npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\liuchaokun\AppData\Local\npm-cache\_logs\2025-07-27T16_34_12_941Z-debug-0.log
最新发布
07-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

西 洲

谢谢请喝奶茶~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值