What version of Vue am I running in Nuxt 2.14.0?

13.2k views Asked by At

I'm trying to identify if my Nuxt app (2.14.0) is using Vue 2 or Vue 3, and I cannot tell. I have dived through node_modules and looked at my lock file but can't say for certain. I think it's using only Vue 2 -- specifically vue "^2.6.12 -- based on what I can tell in the lock file.

Does anyone know which version of Vue that Nuxt is using in version 2.14.0 ? I tried reading through this issue to better understand when / if Vue 3 has been introduced and release publicly in Nuxt.js but it sounds like Vue 3 is not incorporated inside any release of Nuxt.js.

3

There are 3 answers

8
Boussadjra Brahim On BEST ANSWER

The current versions of nuxt.js are still using vue 2.6.x, and to make it work with vue 3 main feature (composition api), you should use the module called composition-api.nuxtjs, as you can see in the introduction they say:

@nuxtjs/composition-api provides a way to use the Vue 3 Composition API in with Nuxt-specific features.

0
Kevin Flynn On

If anyone is looking at this thread now do know that currently Nuxt 2 use Vue 2.7.x so composition API is within your reach now :)

0
Grusat On

Maybe you could try npm why vue and check for the lines about nuxt (yarn works exactly the same too: yarn why vue)

[email protected]
node_modules/@nuxt/vue-renderer/node_modules/vue
  vue@"^2.6.12" from @nuxt/[email protected]
  node_modules/@nuxt/vue-renderer
    @nuxt/vue-renderer@"2.15.8" from [email protected]
    node_modules/nuxt
      nuxt@"^2.15.8" from the root project
    @nuxt/vue-renderer@"2.15.8" from @nuxt/[email protected]
    node_modules/@nuxt/server
      @nuxt/server@"2.15.8" from [email protected]
      node_modules/nuxt
        nuxt@"^2.15.8" from the root project
      @nuxt/server@"2.15.8" from @nuxt/[email protected]
      node_modules/@nuxt/core
        @nuxt/core@"2.15.8" from [email protected]
        node_modules/nuxt
          nuxt@"^2.15.8" from the root project

[email protected]
node_modules/@nuxt/vue-app/node_modules/vue
  vue@"^2.6.12" from @nuxt/[email protected]
  node_modules/@nuxt/vue-app
    @nuxt/vue-app@"2.15.8" from [email protected]
    node_modules/nuxt
      nuxt@"^2.15.8" from the root project
    @nuxt/vue-app@"2.15.8" from @nuxt/[email protected]
    node_modules/@nuxt/builder
      @nuxt/builder@"2.15.8" from [email protected]
      node_modules/nuxt
        nuxt@"^2.15.8" from the root project
  peer vue@"^2.0.0" from [email protected]
  node_modules/@nuxt/vue-app/node_modules/vuex
    vuex@"^3.6.2" from @nuxt/[email protected]
    node_modules/@nuxt/vue-app
      @nuxt/vue-app@"2.15.8" from [email protected]
      node_modules/nuxt
        nuxt@"^2.15.8" from the root project
      @nuxt/vue-app@"2.15.8" from @nuxt/[email protected]
      node_modules/@nuxt/builder
        @nuxt/builder@"2.15.8" from [email protected]
        node_modules/nuxt
          nuxt@"^2.15.8" from the root project

So [email protected] uses [email protected] for my example.