PS C:\project\mscodevue> npm install
npm ERR! code ERESOLVE
npm ERR!
npm ERR! While resolving: @vue/cli-plugin-eslint@4.5.11
npm ERR! Found: eslint@7.20.0
npm ERR! node_modules/eslint
npm ERR! dev eslint@"7.20.0" from the root project
npm ERR! peer eslint@">= 4.12.1" from babel-eslint@10.1.0
npm ERR! node_modules/babel-eslint
npm ERR! dev babel-eslint@"10.1.0" from the root project
npm ERR! 2 more (eslint-plugin-vue, vue-eslint-parser)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.11
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR! dev @vue/cli-plugin-eslint@"4.5.11" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.11
npm ERR! node_modules/@vue/cli-plugin-eslint
npm ERR! dev @vue/cli-plugin-eslint@"4.5.11" 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\Administrator\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\Administrator\AppData\Local\npm-cache\_logs\2022-09-15T01_39_04_973Z-debug-0.log
在错误中有一个提示this command with --force, or --legacy-peer-deps
解决办法:
npm install --legacy-peer-deps
或者
npm install --force