search

Home  >  Q&A  >  body text

The version of vue.js used is unknown.

I installed itnpm install -g @vue/cli

After installation, I create a projectvue create hello-world

After creating the project, I run the following command: npm list vue Returns `-- [email protected]. This indicates that the project is using vue.js version 3.2.20

But if you look at package.json, the version of "vue" will be indicated there: "vue": "^3.0.0",

This confuses me. How to fix it? It's not clear to me which version is used in this project. If I go to vue ui then version 3.2.20 is shown there as well. But the project's package.json shows the version is 3.0.0. How to fix it? Explain what's going on?

P粉308089080P粉308089080276 days ago299

reply all(1)I'll reply

  • P粉239164234

    P粉2391642342024-02-27 16:40:32

    The caret (^) in

    package.json means that Vue will be updated to all future minor versions, but not beyond the major version (version 3 in your case).

    The version you get through npm list vue, 3.2.20 conforms to this rule 3.X.X

    For more information about the caret (^) and tilde (~), check the following questions: Difference between tilde and caret.

    reply
    0
  • Cancelreply