How do I remove the error in vue create?

2

I am new to vuejs and vuetify. First I ran the command npm install @vue/cli -g. Then I ran the command vue create test. And I am getting this error:

C:\Users\Dell\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\vue-templat
e-compiler\index.js:10
  throw new Error(
  ^

Error:

Vue packages version mismatch:

- vue@2.5.17 (C:\Users\Dell\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.6.10 (C:\Users\Dell\AppData\Roaming\npm\node_modules\@
vue\cli\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for
 both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify sho
uld bump vue-template-compiler to the latest.

   at Object.<anonymous> (C:\Users\Dell\AppData\Roaming\npm\node_modules\@vue\c
li\node_modules\vue-template-compiler\index.js:10:9)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\Dell\AppData\Roaming\npm\node_modules\@vue\c
li\node_modules\vue-jscodeshift-adapter\src\parse-sfc.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:776:30)

Earlier I was running the same command to make vuetify projects. Then there were no errors. So now how do I create a new project in vuetify?

Boidurja Talukdar

Posted 2019-07-05T06:06:09.333

Reputation: 21

Thanks for editing. – Boidurja Talukdar – 2019-07-05T06:21:08.823

1Mods, can I suggest moving this question over to StackOverflow. I think it is more suitable and will get more visibility there – hanxue – 2019-08-02T03:21:03.070

Yeah I was surprised to see it here. Will add it myself if this is then moved let me know and will close mine as duplicated. – Ryuk – 2019-10-23T22:37:52.843

here it is, feel free to edit it to improve it https://stackoverflow.com/questions/58531851/vue-create-throws-vue-packages-version-mismatch-error/58531860#58531860

– Ryuk – 2019-10-23T22:45:38.373

Answers

2

If you accidentally installed vue package in your user's directory (C:\Users\Dell), then try to remove node_modules directory there ( C:\Users\Dell\node_modules ).

node_modules directory is usually created by npm or yarn command.

How was the version mismatch cuased? It looks like your packages are loaded from different locations:

  • vue@2.5.17 (C:\Users\Dell\node_modules\vue\dist\vue.runtime.common.js)
  • vue-template-compiler@2.6.10 (C:\Users\Dell\AppData\Roaming\npm\node_modules@ vue\cli\node_modules\vue-template-compiler\package.json)

References:

dyanagi

Posted 2019-07-05T06:06:09.333

Reputation: 21

1

Following worked for me:

npm install vue

The above command showed + vue@2.6.10

Edit the file C:\Users\Dell\node_modules\vue\dist\vue.runtime.common.js. This file listed on the first line of the error above.

At line 5001 there is following line:

Vue$3.version = '2.5.11';

change that to

Vue$3.version = '2.6.10';

Then run vue create.

Tusshu

Posted 2019-07-05T06:06:09.333

Reputation: 111