关于 npm install报错

 npm error code ERESOLVE

 ERESOLVE 表明这是一个依赖关系解析错误

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @vue/eslint-config-standard@6.1.0
npm error Found: eslint-plugin-vue@8.7.1
npm error node_modules/eslint-plugin-vue
npm error   dev eslint-plugin-vue@"^8.0.3" from the root project
npm error
npm error Could not resolve dependency:
npm error peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm error node_modules/@vue/eslint-config-standard 
npm error   dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm error
npm error Conflicting peer dependency: eslint-plugin-vue@7.20.0
npm error node_modules/eslint-plugin-vue
npm error   peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm error   node_modules/@vue/eslint-config-standard
npm error     dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or 
retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error D:\nodejs\node_cache\_logs\2024-08-31T10_21_55_492Z-eresolve-report.txt
npm error A complete log of this run can be found in:

这个错误表示版本冲突问题,npm error peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0   该模块需要 eslint-plugin-vue 的版本为 ^7.0.0但是在项目的依赖中已经存在 eslint-plugin-vue@8.7.1。这导致了 npm 不能正确解析依赖关系,因此抛出了 ERESOLVE 错误。  当然 你自己用什么版本上面就是什么版本,不一定和我的版本一样

解决方法:

                使用 npm install eslint-plugin-vue@7.x     将 eslint-plugin-vue 降级 降到 7的版本  或者

使用 npm update @vue/eslint-config-standard 升级到更高版本的 @vue/eslint-config-standard 支持 你所拥有 eslint-plugin-vue 的版本  如果你的 @vue/eslint-config-standard  已经是最高版本了就用  npm install eslint-plugin-vue@7.x (7.x是我要的版本,你要什么版本你对照一下你的报错日志信息)来下载指定版本

如果暂时不想解决版本冲突问题,可以使用 npm install --legacy-peer-deps 标志来忽略 peer dependencies 的要求

当然,降级你也可以去你的  package.json 里 找到这个,手动改版本

"devDependencies": {
  "eslint-plugin-vue": "^7.0.0"
}

差不多就好咯,反正我是这样啦

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值