i18n: [NEXT] Cannot start nuxt: Cannot find module 'node_modules/vue-i18n/dist/vue-i18n.mjs'
Hi,
I’m currently using vue-i18n as a plugin in a Nuxt 3 project but I would like to switch to @nuxtjs/i18n as soon as possible. I tried to installed the alpha version but as soon as I declare the module in nuxt.config.js, I’ve got an error when I do npm run dev.
Cannot find module '.../node_modules/vue-i18n/dist/vue-i18n.mjs'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:983:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:976:15)
at resolveExports (node:internal/modules/cjs/loader:493:14)
at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:243257)
at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:261:29)
at setupAlias (node_modules/@nuxtjs/i18n/dist/module.mjs:25:36)
at setup (node_modules/@nuxtjs/i18n/dist/module.mjs:541:11)
at async Object.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:642:5)
at async installModule (node_modules/nuxt/node_modules/@nuxt/kit/dist/index.mjs:456:3)
at async initNuxt (node_modules/nuxt/dist/index.mjs:1606:7)
at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6828:5)
at async _main (node_modules/nuxi/dist/cli.mjs:50:20)
Indeed there is no such file in node_modules/vue-i18n/dist/ Any help will be appreciated!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 28
I think I solved the issue, with defining the override within
package.jsonfor now:Hi, I have the same problem on a fresh nuxt3 project :
@Cyclodex my
npm ls vue-i18nis :==========
EDIT : Thanks @Cyclodex, using “^9.3.0-beta.14” work great. Now my
npm ls vue-i18nis :@kazupon No worries for the delay and thank you but you closed this thread based on the second error I mentioned. I tried again on a new project and yes the
Cannot read properties of undefined (reading 'path')error is gone but not theCannot find module '.../node_modules/vue-i18n/dist/vue-i18n.mjs'I declared for this thread when trying to install @nuxti18n in a project already working.I can’t share my project but maybe @ahoiroman , @LePtiDev or @smartfox87 have an example they can share please?
Otherwise I’ll try to reproduce on a fresh project when I have some time, but I just saw that in a new project the vue-i18n.msj is there but not on my current project even if I’m doing the same command and config!