解决报This may cause things to work incorrectly. Make sure to use the same version for both.的问题

在构建项目时遇到了一个问题,This may cause things to work incorrectly. Make sure to use the same version for both.

ERROR in ./src/view/audit/winddczy/winddczy.vue
Module build failed: Error:

Vue packages version mismatch:

- vue@2.5.16 (D:\Desktop\gz\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.7.10 (D:\Desktop\gz\dev\code\web\branches\master\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> (D:\Desktop\gz\dev\code\web\branches\master\node_modules\vue-template-compiler\index.js:10:9)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\Desktop\gz\dev\code\web\branches\master\node_modules\vue-loader\lib\parser.js:1:80)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
 @ ./src/router/index.js 117:13-72
 @ ./src/main.js
 @ multi babel-polyfill ./src/main.js

显而易见,这是vue和vue-template-compiler版本不一致导致的,vue的版本是2.5.16,而vue-template-compiler的版本是2.7.10。把vue卸载后安装2.7.10的就可以。

卸载vue@2.5.16

npm uninstall vue@2.5.16 

安装vue@2.7.10

npm install vue@2.7.10
  • 7
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值