Vue-cli: Vue packages version mismatch on vue create project

Created on 10 Oct 2019  路  3Comments  路  Source: vuejs/vue-cli

Version

3.11.0

Environment info

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 8.15.1 - ~/.nvm/versions/node/v8.15.1/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.15.1/bin/npm
  Browsers:
    Chrome: 77.0.3865.90
    Firefox: 69.0.2
    Safari: 13.0.2
  npmGlobalPackages:
    @vue/cli: 3.11.0

Steps to reproduce

  1. I am executing vue create myproject and I am receiving the following
/Users/user/.config/yarn/global/node_modules/vue-jscodeshift-adapter/node_modules/vue-template-compiler/index.js:10
  throw new Error(
  ^

Error:

Vue packages version mismatch:

- [email protected] (/Users/user/.config/yarn/global/node_modules/vue/dist/vue.runtime.common.js)
- [email protected] (/Users/user/.config/yarn/global/node_modules/vue-jscodeshift-adapter/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 should bump vue-template-compiler to the latest.

    at Object.<anonymous> (/Users/user/.config/yarn/global/node_modules/vue-jscodeshift-adapter/node_modules/vue-template-compiler/index.js:10:9)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/user/.config/yarn/global/node_modules/vue-jscodeshift-adapter/src/parse-sfc.js:1:80)
    at Module._compile (module.js:653:30)

What is expected?

To create a new project

What is actually happening?

Not creating the project

needs feedback

Most helpful comment

I met the same problem(vue-cli: 4.2.2, yarn: 1.22.0, mac: 10.14.6).
I remove all the file in .config/yarn/global/, which include node_modules, package.json, yarn.lock. Then yarn global add @vue/cli again, vue create [project-name] works.

All 3 comments

Somehow you have an incorrectly hoisted global vue package, or maybe you have mistakenly run yarn global add vue before (which does not have any effect except for messing up the global node_modules directory).
Try yarn global remove vue. If this doesn't help, then try yarn global add [email protected] to make the versions match.

It worked, thanks!

I met the same problem(vue-cli: 4.2.2, yarn: 1.22.0, mac: 10.14.6).
I remove all the file in .config/yarn/global/, which include node_modules, package.json, yarn.lock. Then yarn global add @vue/cli again, vue create [project-name] works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Benzenes picture Benzenes  路  3Comments

brandon93s picture brandon93s  路  3Comments

eladcandroid picture eladcandroid  路  3Comments

CodeApePro picture CodeApePro  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments