nuxt: After nuxt installation npm run dev occurs error
Environment
Nuxt project info: 17:59:17
- Operating System:
Windows_NT - Node Version:
v18.14.2 - Nuxt Version:
3.3.1 - Nitro Version:
2.3.1 - Package Manager:
yarn@1.22.19 - Builder:
vite - User Config:
- - Runtime Modules:
- - Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-wdaflq-jqcxbf?file=nuxt.config.ts
just follow installation guide on https://nuxt.com/docs/getting-started/installation
and type on terminal npm run dev
Describe the bug
after npm run dev errors on terminal console:
Nuxi 3.3.1 17:56:23
Nuxt 3.3.1 with Nitro 2.3.1 17:56:23
17:56:24
Local: http://localhost:3000/ Network: http://172.27.160.1:3000/ 17:56:23
Network: http://172.31.16.1:3000/ Network: http://192.168.0.125:3000/
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/ofetch/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/ofetch/dist/index.mjs?v=babcfa76) in C:/codes/vscode-workspace/node_modules/nuxt/dist/app/entry.js. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76) in virtual:nuxt:C:/codes/vscode-workspace/nuxt-test/.nuxt/paths.mjs. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/nuxt/dist/head/runtime/plugins/unhead.js?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/nuxt/dist/head/runtime/plugins/unhead.js?v=babcfa76) in virtual:nuxt:C:/codes/vscode-workspace/nuxt-test/.nuxt/plugins/client.mjs. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/nuxt/dist/head/runtime/plugins/vueuse-head-polyfill.js?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/nuxt/dist/head/runtime/plugins/vueuse-head-polyfill.js?v=babcfa76) in virtual:nuxt:C:/codes/vscode-workspace/nuxt-test/.nuxt/plugins/client.mjs. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76) in virtual:nuxt:C:/codes/vscode-workspace/nuxt-test/.nuxt/paths.mjs. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/h3/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/h3/dist/index.mjs?v=babcfa76) in C:/codes/vscode-workspace/node_modules/nuxt/dist/app/plugins/router.js. Does the file exist?
17:56:25
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/h3/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/h3/dist/index.mjs?v=babcfa76) in C:/codes/vscode-workspace/node_modules/nuxt/dist/app/plugins/router.js. Does the file exist? (x2)
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76 (resolved id: C:/codes/vscode-workspace/node_modules/ufo/dist/index.mjs?v=babcfa76) in virtual:nuxt:C:/codes/vscode-workspace/nuxt-test/.nuxt/paths.mjs. Does the file exist?
ERROR Failed to load url /@fs/C:/codes/vscode-workspace/node_modules/@nuxt/ui-templates/dist/templates/welcome.vue (resolved id: C:/codes/vscode-workspace/node_modules/@nuxt/ui-templates/dist/templates/welcome.vue) in C:/codes/vscode-workspace/nuxt-test/app.vue. Does the file exist?
Additional context
No response
Logs
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 21 (5 by maintainers)
I could solve it by setting
nuxt.config.js
This is also worked for me, on mac m1, linux debian bookworm x86/amd64 and windows running on parallels all of them use the same packages. The weird thing is in my package.json says I have nuxt
3.6.2and usingnpx nuxi@latest infoit says i have3.6.0After upgrading to 3.5.2, the error message changed to say yaml package has problem, could not find the directive.js. delete lock file and node_modules folder, re-run yarn install, same error. I have to copy all files to another folder (excluding lock file and node_modules), and re-run yarn install, everything becomes fine
In a previous project, I made a PWA application and the service worker was installed and launched on localhost:3000 After stopping the service worker, everything worked as it should… Thank you!
@songjianet Do you see anything here? I don’t have anything registered right now, so I can’t explain exactly what operation I need to do to delete it.
I was also having a very hard time working with the same error message.
But in my case, I had tried the PWA module the day before and it was not working properly, so I gave up using it and deleted the project. I had forgotten that such a thing had happened, but the reason was that the Service Worker at that time was still always waiting at port3000 in the browser and was interfering with the port of the new working project.
I opened Developer Tools and deleted the Service Worker registration and the problem was solved.
Hello guys, I have the same issue with a fresh install of the Nuxt v3.3.1 app:
And these in the browser console: