最近想看看新东西,就去github上找了个项目边做边学
结果在第一步npm install就遇上了问题
bash
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: blog-vue-ts-vite@0.0.0
npm ERR! Found: vue@3.4.27
npm ERR! node_modules/vue
npm ERR! vue@"^3.4.27" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.1.x" from element-plus@1.0.2-beta.71
npm ERR! node_modules/element-plus
npm ERR! element-plus@"^1.0.2-beta.71" 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 install 时遇到了依赖冲突的错误,这是因为 vue 和 element-plus 的版本不兼容。
powershell
npm install vue@^3.4.27
npm install element-plus@^2.0.0
npm install vue-router@^4.3.2
改一改版本就好了,OK,跑成功了,继续学