NodeJS 安装vue-i18 n导致vite错误

c9qzyr3d  于 2023-05-28  发布在  Node.js
关注(0)|答案(1)|浏览(330)

尝试安装vue-i18 n没有运气,请参阅我的错误波纹管

npm install vue-i18n
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: MPS@undefined
npm ERR! Found: vue@2.7.14
npm ERR! node_modules/vue
npm ERR!   dev vue@"^2.6.12" 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! 
npm ERR! For a full report see:
npm ERR! /Users/yohanesai/.npm/_logs/2023-05-24T17_16_32_468Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yohanesai/.npm/_logs/2023-05-24T17_16_32_468Z-debug-0.log

有尝试与--legacy-peer-deps,我可以安装它,但当尝试npm run dev是要更疯狂,(更多的错误)。所以我认为错误很重要,我无法避免错误。如果我坚持安装vue i18 n,这就是错误

Error: Build failed with 3 errors:
../../node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:8:9: ERROR: No matching export in "../../../node_modules/vue/dist/vue.runtime.esm.js" for import "createVNode"
../../node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:8:22: ERROR: No matching export in "../../../node_modules/vue/dist/vue.runtime.esm.js" for import "Text"
../../node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:8:70: ERROR: No matching export in "../../../node_modules/vue/dist/vue.runtime.esm.js" for import "Fragment"

我错过了什么?我使用节点v19.8.1和npm 9.5.1

4c8rllxm

4c8rllxm1#

这是一个lib版本依赖错误,在本例中,您使用的是Vue 2,而vue-i18n@9. 2. 2需要Vue3,因此您需要将Vue2升级到Vue3(可能我会破坏您的实际代码)或将vue-i18n降级到8.x

相关问题