安装npm install element-plus --save报错
今天安装npm install element-plus --save报的错,豆包提示说是项目里使用的 eslint
版本是 7.32.0
,而 @vue/eslint-config-standard@9.0.1
要求的 eslint
版本是 ^9.10.0
。总之就是说版本不兼容
报错:
While resolving: vue3_project@0.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! Fix the upstream dependency conflict, or retry
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! 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!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
解决:
- 删除node_modules包和 package-lock.json 文件
- 看了下我的node 版本是18.12.1,太高了,所以安装出了问题,于是就切换了低一些的版本16.13.1,具体切换方式:node版本的升级和降级_nodejs怎么降低版本-CSDN博客
- npm install --force
- npm install --legacy-peer-deps
- 问题成功解决,可以启动项目啦!!