Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error after reinstall #1923

Open
HipyCas opened this issue Oct 28, 2024 · 1 comment
Open

Import error after reinstall #1923

HipyCas opened this issue Oct 28, 2024 · 1 comment

Comments

@HipyCas
Copy link

HipyCas commented Oct 28, 2024

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:
image

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 the nuxt prepare script, same happens with nuxt dev):
image

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.

@lvbaiying
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants