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

Nuxt version is specified to be 3.15.3, but resolving as 3.13.2 #30763

Closed
AloisSeckar opened this issue Jan 26, 2025 · 5 comments
Closed

Nuxt version is specified to be 3.15.3, but resolving as 3.13.2 #30763

AloisSeckar opened this issue Jan 26, 2025 · 5 comments

Comments

@AloisSeckar
Copy link
Contributor

I have recently started a new project - https://github.com/AloisSeckar/nuxt-spec - it should serve as a base layer to provide testing functionality to my other apps. So I dont have to maintain a set of dependencies in each project separately.

As you can see in the package.json, the Nuxt version is specified to be the latest - 3.15.3:

  "dependencies": {
    "@nuxt/test-utils": "3.15.4",
    "@vue/test-utils": "2.4.6",
    "happy-dom": "16.7.2",
    "playwright-core": "1.50.0",
    "vitest": "3.0.4"
  },
  "devDependencies": {
    "@nuxt/eslint": "0.7.5",
    "nuxt": "3.15.3",
    "typescript": "latest"
  },

Compatibility date in nuxt.config.ts is set to 2025-01-26

However, after fresh install (I already tried to delete all node_modules and also ran pnpm store prune), using pnpm dev always resolves .nuxt to version 3.13.2.

I fail to understand where this comes from. I guess it is one of the other dependencies, but I don't see the pattern 🤔

@danielroe
Copy link
Member

Do you get a warning message - is that the issue?

@AloisSeckar
Copy link
Contributor Author

AloisSeckar commented Jan 26, 2025

No warnings, the project seems to start just fine

Image

There is a warning coming from Vitest when running tests though

Image

Plus I am getting error messages like this when trying to run E2E tests - I think it might be related to the old version of Nuxt being used

[nuxt] [request error] [unhandled] [500] 
Cannot find module '<<local_path>>\.nuxt\test\ou7tq5\output\server\node_modules\vue\server-renderer\index.mjs' 
imported from <<local_path>>\.nuxt\test\ou7tq5\output\server\chunks\routes\renderer.mjs  

@AloisSeckar
Copy link
Contributor Author

I deleted all pnpm packages and re-downloaded them fresh again. Same thing

Image

Must be my local issue though, because on StackBlitz it works 🤔

Image

@AloisSeckar
Copy link
Contributor Author

Is there something like a "local Nuxt cache" where the older version should have stuck? Because this is what happens when I try to initialize the fresh project using npx nuxi@latest init <project-name> from the docs.

Version 3.15.4 is referrenced in package.json, version 3.13.2 appears on runtime. Dafuq?

PS C:\Programming\Git> npx nuxi@latest init nuxt-clean

✔ Which package manager would you like to use?
pnpm
◐ Installing dependencies...                                                                                                      nuxi 17:35:13  
 WARN  2 deprecated subdependencies found: glob@7.2.3, inflight@1.0.6
Packages: +604
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
Progress: resolved 659, reused 602, downloaded 2, added 604, done
node_modules/.pnpm/esbuild@0.24.2/node_modules/esbuild: Running postinstall script, done in 339ms
node_modules/.pnpm/@parcel+watcher@2.5.1/node_modules/@parcel/watcher: Running install script, done in 114ms

> nuxt-app@ postinstall C:\Programming\Git\nuxt-clean
> nuxt prepare

✔ Types generated in .nuxt                                                                                                       nuxi 17:35:24

dependencies:
+ nuxt 3.15.4
+ vue 3.5.13
+ vue-router 4.5.0

Done in 11.1s
✔ Installation completed.                                                                                                        nuxi 17:35:24
No
                                                                                                                                  nuxi 17:35:29  
✨ Nuxt project has been created with the v3 template. Next steps:
 › cd nuxt-clean                                                                                                                  nuxi 17:35:29  
 › Start development server with pnpm run dev                                                                                     nuxi 17:35:29  
PS C:\Programming\Git> cd nuxt-clean
PS C:\Programming\Git\nuxt-clean> pnpm run dev

> nuxt-app@ dev C:\Programming\Git\nuxt-clean
> nuxt dev

Nuxt 3.13.2 with Nitro 2.10.4                                                                                                     nuxi 17:35:37
                                                                                                                                       17:35:37
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

  ➜ DevTools: press Shift + Alt + D in the browser (v1.4.2)                                                                            17:35:40  

✔ Vite client built in 157ms                                                                                                          17:35:42   
✔ Vite server built in 648ms                                                                                                          17:35:42   
✔ Nuxt Nitro server built in 1074 ms                                                                                            nitro 17:35:43   
ℹ Vite client warmed up in 1ms                                                                                                        17:35:43   
ℹ Vite server warmed up in 674ms                                                                                                      17:35:44   

@AloisSeckar
Copy link
Contributor Author

So (with a help of ChatGPT) using npx which nuxt command, I have found there is a generated file:

/node_modules/.bin/nuxt.CMD

And among a NODE_PATH path definition it also contains:

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\nuxt\bin\nuxt.mjs" %*
) ELSE (
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\nuxt\bin\nuxt.mjs" %*
)

I followed that trail into my local Node.js installation and voila - in parent directory of my Node, there were some messed up installation of a Nuxt project with a version - who would say - 3.13.2 😅 So I deleted the files and all started working as expeted.

I cant say I understand all the mechanics yet, but it was just my mess. Nothing is wrong with Nuxt itself.

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

No branches or pull requests

2 participants