javascript - Vue add i18n 返回 ERROR TypeError: Cannot read property 'minVersion' of undefined
问题描述
我尝试运行 vue clivue add i18n
以使用 i18n 生成本地化到我的本地。出错了
Done in 37.95s.
✔ Successfully installed plugin: vue-cli-plugin-i18n
ERROR TypeError: Cannot read property 'minVersion' of undefined
TypeError: Cannot read property 'minVersion' of undefined
at module.exports.pkg (/mnt/disks/data_disks/teja/localised/forexsignals/node_modules/vue-cli-plugin-i18n/prompts.js:5:26)
at invoke (/usr/local/lib/node_modules/@vue/cli/lib/invoke.js:74:25)
at process._tickCallback (internal/process/next_tick.js:68:7)
和i18n.js
其他文件不会生成。
否则,我想尝试手动添加 i18n,npm install
然后手动添加文件,但停留在编辑状态vue.config.js
,如下vue.config.js
所示
var PrerenderSpaPlugin = require('prerender-spa-plugin')
var path = require('path')
var Renderer = PrerenderSpaPlugin.PuppeteerRenderer;
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV !== 'production') return
return {
plugins: [
new PrerenderSpaPlugin(
{
staticDir: path.resolve(__dirname, 'dist'),
routes: ['/', '/join-free-channel'],
renderer: new Renderer({
headless: true
})
}
),
]
}
}
}
我已经为我的 vue 应用程序安装了预渲染来更新我的vue.config.js
文件,但仍然不知道如何通过编辑向应用程序添加国际化vue.config.js
解决方案
我最近遇到了这个问题,这是由于缺少@vue/cli-shared-utils依赖引起的。我不确定为什么在安装vue-cli时没有安装它。
一个快速解决这个问题的方法是安装这个依赖:npm i @vue/cli-shared-utils
安装后,vue add i18n
再次运行,它应该可以正常工作。
推荐阅读
- excel - VBA - 如何取消隐藏列?
- python - 运行我的机器人的 python 代码返回了一个语法错误,我不知道错误是什么
- haskell - Haskell 中是否有返回其参数类型(或显示类型的字符串)的函数?
- docker - 构建无堆栈的 docker 镜像
- kubernetes - 如何强制删除 kubernetes pod?
- python - 当我已经通过 pip 安装了模块时,为什么它一直说 ImportError: No module named pydot?
- java - 编译器如何执行信息隐藏和封装?
- php - 使用 MeekroDB 从 TinyMCE 插入 HTML
- laravel - Laravel - 使用不同日期格式播种模型时出错
- python - 为什么 Datatime.now() 的相邻调用在 Windows 上给出相同的结果