0

I have an issue with installing nuxt.

The thing is,yarn global list shows

info "create-nuxt-app@2.8.0" has binaries:
      - create-nuxt-app

After running yarn create nuxt-app I check my package.json which shows "nuxt": "^2.0.0"

Why so? I checked that the latest nuxt version is 2.8.1, shouldn't it be 2.8.1 in package.json?

Victor
  • 5,073
  • 15
  • 68
  • 120

1 Answers1

1

There are two different packages at play here. First we have create-nuxt-app, which scaffolds your project and is at version 2.8.0.

That scaffold contains the package.json template, which is used to generate the package.json of your project. It contains "nuxt": "^2.0.0", where the ^ means: "Get me the latest minor version (and patch version) of nuxt 2", which as time of writing is 2.8.1. See also What's the difference between tilde(~) and caret(^) in package.json?

In conclusion, there is no need to update that template file everytime a new nuxt version is released, you'll always get the latest 2.x.x version of nuxt.

Alex
  • 56
  • 5
  • Does it mean that after scaffolding my nuxtjs project I'll need to update nuxt version manually since I get 2.0.0 which is written in create-nuxt-app package.json template? – Victor Jul 21 '19 at 13:45
  • No, you don't need to do that, as you get the latest version beginning with 2.x.x, which is 2.8.1. Note that the caret symbol `^` is the important part. If it were just `2.0.0` without the `^`, then you would get only the version `2.0.0`. – Alex Jul 21 '19 at 14:38
  • Thank you Alex, I swear I knew this :) – Victor Jul 21 '19 at 16:22