vue版本冲突解决办法

ERROR in

Vue packages version mismatch:

  • vue@2.1.4
  • vue-template-compiler@2.1.5

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.

@ ./main.js 15:11-27

卧槽,简直了,只要我import app.vue 就报错,无论我app.vue有木有写东西,都报错,我也是醉了

回来发现,原来是我的package.json里面忘记依赖了vue-loader,好吧,我赶紧依赖了一下,结果又报错,说我vue-loader和vue-template-complier版本不一致

我赶紧把版本改成一致的,然后,npm install,结果还是这么报错。

最后上了大招,直接在node-modules文件夹下面把不一致的vue-loader和vue-template-complier文件夹干掉之后,再重新npm install 终于ok了!!!

{
  "name": "vue-demo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel": "^6.5.2",
    "babel-core": "^6.18.2",
    "babel-loader": "^6.2.8",
    "babel-preset-es2015": "^6.18.0",
    "css-loader": "^0.26.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "less": "^2.7.1",
    "less-loader": "^2.2.3",
    "style-loader": "^0.13.1",
    "vue": "2.1.4",
    "vue-loader": "10.0.0",
    "vue-router": "latest",
    "vue-template-compiler": "2.1.4",
    "webpack": "^1.13.3"
  },
  "dependencies": {
    "webpack": "^1.13.3"
  }
}

转载于:https://www.cnblogs.com/ae6623/p/6175716.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值