vue-loader: Vue packages version mismatch error

Vue packages version mismatch:

- vue@2.0.5
- vue-template-compiler@2.0.6

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader or vueify, re-installing them should bump vue-template-compiler to the latest.

In our project, we use exact dependencies:

    "vue": "2.0.5",
    "vue-loader": "9.7.0",

Since vue-loader uses caret ranges for vue-template-compiler

"vue-template-compiler": "^2.0.5",

…when our Jenkins CI job runs npm install, the latest version of vue-template-compiler will get installed and will mismatch our vue version, causing random build failures whenever vue-template-compiler is upgraded.

A workaround suggested here https://github.com/vuejs/vue/issues/3941 is to re-install vue-loader. We would rather work with exact versions of our dependencies and choose on our own when to upgrade.

To make matters more difficult, we can’t use shrinkwrap in our repository due to https://github.com/npm/npm/issues/2679.

Can vue or vue-loader address this case somehow?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 15 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Fixed for me:

npm install vue-template-compiler --save-dev

│ └─┬ vue-loader@9.9.5
│   └── vue-template-compiler@2.2.6  deduped
└─┬ vue-template-compiler@2.2.6 
  └──` he@1.1.1 

For me it was because my Vue version was behind my vue-template-compiler by 4 patches (vue@2.6.6 vs vue-template-compiler@2.6.10). I just updated vue both globally and locally and everything worked.

So with Yarn as my package manager:

yarn global add vue
yarn add vue

same mismatch problem with new spark 4.09 install.

Have you considered using yarn with a lockfile?

Fixed for me:

npm install vue-template-compiler --save-dev

│ └─┬ vue-loader@9.9.5
│   └── vue-template-compiler@2.2.6  deduped
└─┬ vue-template-compiler@2.2.6 
  └──` he@1.1.1 

This was what I needed… Very thanks!

You need check your vue version in global. I removed the old vue version in global then npm install vue@2.2.4 -g,That solved my issue.

Just cleaned the yarn cache and tried again, now it works well !