nuxt: Nuxt 3 - fresh install on Windows - cannot find module

Environment

Nuxt CLI v3.0.0-27243104.5e903ae 10:48:58 RootDir: c:\testing\nuxt3-app 10:49:00 Nuxt project info: 10:49:00


  • Operating System: Windows_NT
  • Node Version: v16.11.1
  • Nuxt Version: 3.0.0-27243104.5e903ae
  • Package Manager: Yarn
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Describe the bug

Nuxt CLI reports it cannot find module, the web page is stuck on “Starting nuxt…” with NuxtJS logo and light/dark mode flashing background.

Reproduction

Followed the New project in docs.

npx nuxi init nuxt3-app
cd nuxt3-app
yarn install
yarn dev -o

(happens both with yarn and npm)

The directory of requested module, “nuxt3-app.nuxt\server”, doesn’t exist. I only see “server” directory inside “nuxt3-app.nuxt\dist\server”, but that one doesn’t have index.mjs

Logs

Nuxt CLI v3.0.0-27243104.5e903ae                                                                          10:52:05
                                                                                                          10:52:05
  > Local:    http://localhost:3000/
  > Network:  http://172.24.96.1:3000/
  > Network:  http://172.18.48.1:3000/
  > Network:  http://192.168.56.1:3000/
  > Network:  http://192.168.86.79:3000/

i Vite warmed up in 685ms                                                                                 10:52:08
√ Generated nuxt.d.ts                                                                                     10:52:08
√ Vite server built in 956ms                                                                              10:52:09
√ Nitro built in 81 ms                                                                                    10:52:09

 WARN  [worker] Cannot find module 'c:\testing\nuxt3-app\.nuxt\server\index.mjs' imported from c:\testing\nuxt3-app\.nuxt\nitro\index.mjs

  at new NodeError (node:internal/errors:371:5)
  at finalizeResolution (node:internal/modules/esm/resolve:416:11)
  at moduleResolve (node:internal/modules/esm/resolve:932:10)
  at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:1044:11)
  at Loader.resolve (node:internal/modules/esm/loader:89:40)
  at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
  at link (node:internal/modules/esm/module_job:75:36)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 19 (5 by maintainers)

Most upvoted comments

That’s because it’s a fresh install using only the four commands specified above, with zero additional modifications.

…minimal reproduction is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem…

But sure, I’ve pushed the folder as is into https://github.com/mnlj/nuxt3-1226.

+1 on Windows

This is no longer reproducible. If you’re still experiencing this, would you create a reproduction please?

This problem is a directory problem most likely due an incorrect path, so far the work around develop from C:\dev\appname …

@danielroe I’m afraid this is still reproducible using the reproduction from the original post. The only pre-requisite is to use Windows 10 operating system. I’ve tried it right now, with Nuxt updated to (at the moment latest) 3.0.0-27264486.37f86a0, on latest Node versions 14.18.1 and 16.13.0. The logs output is exactly the same as the one the original post.

@MartCube the assumption was based on the fact that under the same conditions it worked on macOS and inside WSL (Debian), and somewhat common issue with working with paths in Windows vs. unix systems.

I don’t think its relevant for windows since I get this error on Ubuntu 20.04