vue-i18n 多语言安装依赖失败

在vue2环境下,默认安装 npm install vue-i18n 的版本是 vue-i18n@9.2.2,所以报错信息如下:

PS D:\myFile\dev\YSJ-dev\cbj-mall-manage> npm i vue-i18n -save npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: vue-admin-template@4.4.0 npm ERR! Found: vue@2.6.10 npm ERR! node_modules/vue npm ERR! vue@"2.6.10" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer vue@"^3.0.0" from vue-i18n@9.2.2 npm ERR! node_modules/vue-i18n npm ERR! vue-i18n@"*" 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 ERR! See C:\Users\Administrator\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! peer vue@"^3.0.0" from vue-i18n@9.2.2 (意思是版本不匹配)
npm view vue-i18n versions --json 命令查看所有的版本
选择安装合适的版本即可

后面我 使用的是5.0.0 npm install vue-i18n@5


 

posted @ 2022-10-11 15:39  多喝热水,早点睡觉  阅读(2382)  评论(0编辑  收藏  举报