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"
}
差不多就好咯,反正我是这样啦