NPM run dev 遇到的报错!vue 和 vue-template-compiler 版本不一致

NPM run dev 遇到的报错!vue 和 vue-template-compiler 版本不一致

  1. npm run dev 时报错:
ERROR in ./resources/assets/js/components/steps.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):
Vue packages version mismatch:
- vue@2.6.5
- vue-template-compiler@2.6.6
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.
 @ ./resources/assets/js/app.js 12:13-46
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
ERROR in ./resources/assets/js/components/steps.vue
Module build failed (from ./node_modules/vue-loader/lib/index.js):
TypeError: Cannot read property 'parseComponent' of undefined
    at parse (/home/vagrant/Code/Taskmanager/node_modules/@vue/component-compiler-utils/dist/parse.js:14:23)
    at Object.module.exports (/home/vagrant/Code/Taskmanager/node_modules/vue-loader/lib/index.js:67:22)
 @ ./resources/assets/js/app.js 12:13-46
 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

package.json 文件中同一一下版本:

 "dependencies": {
        "vue": "2.5.21",
        "vue-template-compiler": "2.5.21"
    }

npm install npm update 就解决了。

发表评论

电子邮件地址不会被公开。 必填项已用*标注