无法使用 nuxt-i18n(版本 5.4.2)

Can not use nuxt-i18n (version 5.4.2)

在我的 Nuxt.js 应用程序中,我想使用 nuxt-i18n 的最新版本 (5.4.2)。以前用过没问题,现在不明白是怎么回事:

版本

v5.4.2

复制link

https://github.com/begueradj/nuxti18nerror

重现步骤

  1. 克隆我的项目并按照 README 文件说明进行操作
  2. 或者创建一个Nuxt.js项目:yarn create nuxt-app my-project,然后安装插件:yarn add nuxt-i18n,然后按照官方文档的说明添加到配置文件nuxt.config.js : modules: [ ['nuxt-i18n', { // Options }] ]

预期是什么?

我希望在 运行 yarn run dev 时能够无错误地启动服务器。就这么简单。

实际发生了什么?

当我 运行 yarn run dev 时收到此错误消息:

 INFO  Building project

✖ fatal /home/begueradj/nuxti18nerror/node_modules/nuxt-i18n/src/helpers/components.js:1
  Error: Cannot find module 'acorn-walk'
  at Object.<anonymous> (/home/begueradj/nuxti18nerror/node_modules/nuxt-i18n/src/helpers/components.js:5:16)
  at Object.Module._extensions..js (module.js:664:10)
Nuxt Fatal Error :(
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

对于遇到同样问题的任何人,我的老板在我通知他后立即解决了问题:

yarn add acorn-walk

(我认为解决方案不言自明)

更新:

This is officially fixed现在。