我正在尝试构建使用 next-i18next 的 NextJs 应用程序。我的翻译 json 文件位于 public->static->locales 文件夹中。这是我配置 i18 的代码:
const NextI18Next = require("next-i18next").default;
const path = require("path");
module.exports = new NextI18Next({
defaultLanguage: "fr",
otherLanguages: ["en"],
localePath: path.resolve("./public/static/locales"),
});
另一方面,当我运行 npm run build 时收到此错误消息:
发生构建错误 错误:ENOENT:没有这样的文件或目录,scandir 'C:\Users\User fd-hote