前端代码依赖冲突
wohenbushuang opened this issue · comments
wohenbushuang commented
root ➜ /workspaces/web $ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vitejs/plugin-vue@3.2.0
npm ERR! Found: vite@4.5.2
npm ERR! node_modules/vite
npm ERR! dev vite@"^4.2.7" from the root project
npm ERR! peer vite@">=2.0.0" from vite-plugin-compression@0.5.1
npm ERR! node_modules/vite-plugin-compression
npm ERR! dev vite-plugin-compression@"^0.5.1" from the root project
npm ERR! 4 more (vite-plugin-html, vite-plugin-style-import, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vite@3.2.8
npm ERR! node_modules/vite
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.2.0" 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.
照亮照亮 commented
npm install -g yarn
yarn install
Tommy commented
try this, npm install --legacy-peer-deps