What version of Vue am I running in Nuxt 2.14.0?

Viewed 9653

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.

2 Answers

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.

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

vue@2.6.14
node_modules/@nuxt/vue-renderer/node_modules/vue
  vue@"^2.6.12" from @nuxt/vue-renderer@2.15.8
  node_modules/@nuxt/vue-renderer
    @nuxt/vue-renderer@"2.15.8" from nuxt@2.15.8
    node_modules/nuxt
      nuxt@"^2.15.8" from the root project
    @nuxt/vue-renderer@"2.15.8" from @nuxt/server@2.15.8
    node_modules/@nuxt/server
      @nuxt/server@"2.15.8" from nuxt@2.15.8
      node_modules/nuxt
        nuxt@"^2.15.8" from the root project
      @nuxt/server@"2.15.8" from @nuxt/core@2.15.8
      node_modules/@nuxt/core
        @nuxt/core@"2.15.8" from nuxt@2.15.8
        node_modules/nuxt
          nuxt@"^2.15.8" from the root project

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

So nuxt@2.15.8 uses vue@2.6.14 for my example.

Related