Cannot start application, Nuxt loading node modules from incorrect directory
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v17.9.0
- Nuxt Version:
3.0.0-rc.10
- Nitro Version:
0.5.3
- Package Manager:
npm@8.5.5
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
npx nuxi init nuxt-app npm i npm run dev
Describe the bug
Immediately hit with “Cannot find package ‘@vue/server-renderer’ imported from /Users/marco/node_modules/vue/server-renderer/index.mjs”
I’ve tried installing multiple times but no luck so far.
Additional context
Logs
✔ Nitro built in 481 ms
ℹ Vite client warmed up in 1322ms
[nuxt] [request error] [unhandled] [500] Cannot find package '@vue/server-renderer' imported from /Users/marco/node_modules/vue/server-renderer/index.mjs
at new NodeError (node:internal/errors:372:5)
at packageResolve (node:internal/modules/esm/resolve:908:9)
at moduleResolve (node:internal/modules/esm/resolve:957:20)
at defaultResolve (node:internal/modules/esm/resolve:1173:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:604:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
at link (node:internal/modules/esm/module_job:78:36)
^C
Issue Analytics
- State:
- Created a year ago
- Comments:28 (11 by maintainers)
Top Results From Across the Web
nuxt start requires node_modules to be present in order to run
I found Nuxt build will not bundle files in node_modules, so if you want to bundle all dependencies into .nuxt , you should...
Read more >Modules directory - Nuxt
Write your own Module. Modules are functions. They can be packaged as npm modules or directly included in your project source code. nuxt.config.js...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >Cannot find module 'X' error in Node.js | bobbyhadz
If the error is not resolved, try to delete your node_modules and package-lock.json (not package.json ) files, re-run npm install and restart your...
Read more >Creating Server-side Rendered Vue.js Apps Using Nuxt.js
When initially loading your website, your browser doesn't receive a complete page to display. ... cd my-nuxt-project npm install # Or yarn npm...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As an update, we had a quick call with @marcodarko. Removing or renaming stale
node_modules
from home directory solves the issue. It is an environment-specific issue. Trying to find a solution for it but as quick workaround, simply remove the directory.Thanks once again @marcodarko for reproduction. Moving this issue to https://github.com/nuxt/framework/issues/7609. It is related to the vite-node package that is enabled.