一、安装
npm install vue-* --save
二、错误信息
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test@1.0.0
npm ERR! Found: vue@2.7.11
npm ERR! node_modules/vue
npm ERR! vue@"^2.5.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"3.x" from vue-*@6.1.1
npm ERR! node_modules/vue-*
npm ERR! vue-*@"6.1.1" 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.
三、解决方案
1.查看可用版本
npm view vue-* version --json
2.强制安装指定版本
npm install vue-*@6.1.1 --save --force