cannot start dev server
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
5 Replies
Hi @Zhaolin Lau. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
This error on Windows is not described directly in the provided sources, but there are some closely related issues and known constraints that might explain it:
1. Windows + recent Nuxt versions can be fragile with certain Node versions and dependencies
- A user on Windows with Nuxt 4.2.0 reported they “can’t build or run the dev server” locally, while the same project builds fine on Vercel. [Win build issue]
- Another comment notes that changing Node versions (via nvm‑windows) to 22.12.0 fixed their Windows dev environment. [Win build issue]
- A Nuxt collaborator explicitly recommends Node 22.12 or 22.20 and recent pnpm for Windows. [Win build issue]
Given your “Only URLs with a scheme… Received protocol
If changing Node and reinstalling doesn’t help, the next step is to: - Create a minimal Nuxt project (e.g.
c:” message, it’s likely Node’s ESM loader is choking on a plain C:\... path being treated as a URL. That usually comes from:
- older tooling assuming POSIX paths, or
- a mismatch between Nuxt/Nitro/Vite and your Node version on Windows.
2. What you can try, based on these reports
Since we don’t have an exact match for your error in the sources, these are best‑effort steps derived from similar Windows issues:
- Switch Node version using nvm‑windows to one that’s known to work with Nuxt on Windows:
- Install or use nvm-windows, then:
This combination is reported as working by Nuxt collaborators and users. [Win build issue]
- Delete lockfile and reinstall dependencies after changing Node:
- Remove node_modules and your lock file (package-lock.json, pnpm-lock.yaml or yarn.lock), then reinstall.
- Check for dependency issues:
- One user traced their Windows build failure (with Nuxt 4.2.0) to @vueuse 14.0.0 and fixed it by downgrading to 13.9.0 because of Rollup/AST parsing problems on Windows. [Win build issue]
3. If the problem persists
The Nuxt team repeatedly asked for a minimal reproduction repo for Windows‑specific build/dev issues, because they couldn’t reproduce them on their own Windows setups. [Win build issue]If changing Node and reinstalling doesn’t help, the next step is to: - Create a minimal Nuxt project (e.g.
npx nuxi init test-app, install deps, then npx nuxt dev) and see if it reproduces the error.
- If the minimal project works but your app doesn’t, gradually add your dependencies/config until you find the trigger.
- If you can isolate it, share that minimal reproduction in a GitHub issue on the Nuxt repo.
Because the knowledge sources do not mention this exact file:// vs c: ESM loader error, I can’t give a more precise fix than these version and environment steps.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@520675622830342144> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@kapa.ai im already using node v22.21.1
Let me check the knowledge base for you again. One moment! :books:
----------------------
On Windows, the only concrete guidance in the sources is about which Node versions are known to work well with Nuxt 4.x, especially for dev/build issues:
- A Nuxt collaborator explicitly recommends Node 22.12.0 or 22.20.0 (with up‑to‑date pnpm if you use it) on Windows. [Win cannot build]
- Another Windows user “fixed” a non‑working dev environment by switching to 22.12.0 using nvm‑windows. [Win cannot build]
Your version 22.21.1 is newer than what’s mentioned and is not referenced anywhere in the sources, so there is no confirmation it works correctly with Nuxt 4.x on Windows. The knowledge we have is limited to 22.12.0 / 22.20.0.
Given that, the next steps based only on the sources are:
1. Try one of the recommended Node versions with nvm‑windows:
or 22.12.0. [Win cannot build]
2. Clean and reinstall:
- Remove
Creating a tiny repo that shows the error is the only route they suggest for further debugging. The sources do not mention your exact
node_modules and your lockfile.
- Reinstall dependencies with your package manager.
3. If it still fails, the Nuxt team asks for a minimal reproduction for Windows‑specific issues, as they couldn’t reproduce them on their own Windows setups. [Win cannot build]Creating a tiny repo that shows the error is the only route they suggest for further debugging. The sources do not mention your exact
Only URLs with a scheme… Received protocol 'c:' error, so I can’t give a more precise fix than testing with 22.12.0 / 22.20.0 and providing a minimal reproduction if the issue persists.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@520675622830342144> Kapa.ai is still learning and improving, please let me know how I did by reacting below.