報錯
Vue packages version mismatch:
- vue@2.6.14 (/Users/dx/Documents/2021works/TaiTaiLeYingXiaoPC/node_modules/vue/dist/vue.runtime.common.js)
- vue-template-compiler@2.6.11 (/Users/dx/Documents/2021works/TaiTaiLeYingXiaoPC/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.
原因就是vue-template-compiler要和vue版本一致。
網(wǎng)上的方法有:node_modules文件和package.lock-json文件,然后將package.json文件中的vue版本號的 ^ 去除掉。再重新npm install。但不行。文章來源:http://www.zghlxwxcb.cn/news/detail-646092.html
我的解決方法是,先找到項目下的node_modules,刪除vue-template-compiler,之后再運行 npm i vue-template-compiler@2.6.14就解決了。文章來源地址http://www.zghlxwxcb.cn/news/detail-646092.html
到了這里,關于Vue packages version mismatch:VUE版本不匹配的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!