Vue packages version mismatch: 版本始終不對


vue安裝依賴包時,遇到了一個問題,如下

Vue packages version mismatch:

vue@2.6.12
vue-template-compiler@2.6.10
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.

經過排查發現,package.json中vue的版本配置如下:

"vue": "^2.6.10"

在安裝依賴包時,會自動安裝符合條件的高於或等於2.6.10版本的,所有這里安裝了2.6.12版本
但與vue-template-compiler@2.6.10版本不符合

解決方法有兩個:

方法一:

重新安裝 npm i vue-template-compiler@2.6.12 --save

方法二:

修改package.json中vue的版本配置如下:

去掉‘^’,代表安裝時就會安裝2.6.10版本的vue,不會匹配高版本


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM