0

I was checking the version of Vue on my computer, and I noticed I have two different versions. What's wrong here?

I recently updated my Vue CLI to 3.10.0, and got a few errors popping up. I checked my npm packages, and discovered this other version of Vue 2.5.17.

<bash>: npm list -g
vue@2.5.17
└─┬ vue-language-server@0.0.41
  ├─┬ @starptech/prettyhtml@0.8.16
  │ ├─┬ @starptech/prettyhtml-formatter@0.8.16
  │ │ ├── @starptech/expression-parser@0.8.15
  │ │ ├─┬ @starptech/prettyhtml-hast-to-html@0.8.10
  │ │ │ ├── ccount@1.0.3
  │ │ │ ├─┬ comma-separated-tokens@1.0.5
  │ │ │ │ └── trim@0.0.1
  │ │ │ ├── hast-util-is-element@1.0.2 deduped
  │ │ │ ├── hast-util-whitespace@1.0.2
  │ │ │ ├── html-void-elements@1.0.3 deduped
  │ │ │ ├── html-whitespace-sensitive-tag-names@1.0.0 deduped
  │ │ │ ├─┬ property-information@5.0.1
.
.
.
<bash>: vue --version
3.10.0

Anytime is run Vue create I get a bunch of error, and I'm assuming it has to do with my two versions of Vue colliding.

Phil
  • 157,677
  • 23
  • 242
  • 245
mfe96
  • 3
  • 3
  • What are the errors? They won't have anything to do with a mismatch between your Vue Framework or Vue CLI versions – Phil Aug 07 '19 at 03:22
  • actually yes it is that error. I tried updating everything, but still not working. – mfe96 Aug 07 '19 at 03:37
  • Again, what error? – Phil Aug 07 '19 at 03:42
  • There's something strange going on in your dependencies list. `vue-language-server` is a component of [Vetur](https://vuejs.github.io/vetur/) which provides Vue tooling for VS Code. It should never be shown as a dependency of Vue – Phil Aug 07 '19 at 04:05
  • So the error is the "Vue packages version mismatch:". I tried updating my npm packages, uninstalling vue and npm, but things are still being weird. – mfe96 Aug 07 '19 at 04:10
  • Please include the error message in your question exactly how it appears – Phil Aug 07 '19 at 04:11
  • Vue packages version mismatch: - vue@2.5.17 - vue-template-compiler@2.6.10 – mfe96 Aug 07 '19 at 04:16
  • I've gone through the possible fixes as noted in (https://stackoverflow.com/questions/43397688/how-do-i-fix-a-vue-packages-version-mismatch-error-on-laravel-spark-v4-0-9)[here] – mfe96 Aug 07 '19 at 04:19
  • For some reason, you have `vue` (the framework) installed globally. Uninstall it – Phil Aug 07 '19 at 04:25
  • Well, you don't want either of those installed globally, so yes to both. – Phil Aug 07 '19 at 04:34
  • It worked! Thank you so much Phil. – mfe96 Aug 07 '19 at 04:55

1 Answers1

1

There is a significant difference between global and local installs. @vue/cli is latest at 3.10 (as of this writing) and is installed globally because it is run from the command line. vue is usually installed locally and versions can vary from project to project. The latest version of vue is 2.6.10 as of this writing. Unclear why you would have issues with create unless you did not uninstall the prior version of the cli:

"If you have the previous vue-cli (1.x or 2.x) package installed globally, you need to uninstall it first with npm uninstall vue-cli -g"

Ref: https://cli.vuejs.org/guide/installation.html

Some other quick reads:

https://flaviocopes.com/npm-packages-local-global/

https://nodejs.org/en/blog/npm/npm-1-0-global-vs-local-installation/

ExcessJudgment
  • 228
  • 1
  • 9