npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: init@0.0.0
npm ERR! Found: vite@2.3.7
npm ERR! node_modules/vite
npm ERR! dev vite@"2.3.7" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^2.5.10" from @vitejs/plugin-vue@1.10.2
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^1.2.2" 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.
解决方法:终端输入:
npx -p npm@6 npm i --legacy-peer-deps
目的:使用npx
指定npm
的版本
然后npm install即可 ,
如果不起作用,可以先删除node_modules和package-lock.json,再重新尝试。