Open HipyCas opened 2 weeks ago
Sure, I encountered the same issue as you. After investigating, I found that Node versions above 18 indeed lead to some errors when running under Nuxt. Even after running volta install node@18, while node -v shows it switched to version 18, it hasn’t fully switched. For example, npm still points to the originally installed version from Node 22. This has caused some issues during runtime as well. I believe it's due to an incomplete version switch. However, using nvm does not have this issue.
I recently reinstalled volta in my laptop and, after this, I could no longer run a Nuxt project.
The error resides in some type of dependency caching that esm packageResolve uses, in which importing
@nuxt/
dependencies tries to import them from/home/hipy/.volta/tools/image/node/19.4.0/lib/node_modules/
. The version shown in the path is not actually the version used, it always shows the same path regardless of the node version used (tested with 19.4.0 and 20.17.0). The specific codebase in which I use it is not relevant, as even trying to create a new project fails.I have tried both PNPM and NPM. In the case of NPM, when trying to install with the already existing
node_modules
installed with PNPM, I get the following error:On the other hand, with PNPM or with a NPM install without
node_modules
, the error is not from the install process, but rather from the Nuxt execution part (the screenshot shows after an install thenuxt prepare
script, same happens withnuxt dev
):As far as I can understand, I guess it may be some error of broken links, but I cannot get to the bottom of the problem neither solve it. I have removed nuxt_modules, .nuxt and all cache that I was able to with my knowledge.