[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.

Vue2的项目中,控制台报错

[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.

原因是 package.json 中没有锁定Vue的版本

{
    
    
  "dependencies": {
    
    
    "vue": "^2.6.10"
  } 
}

node_modules 装的却是这个版本:

"version": "2.7.4"

修改如下,重新安装

{
    
    
  "dependencies": {
    
    
    "vue": "2.6.10"
  } 
}

版本号的匹配规则:

2.6.10 只匹配 2.6.10
^2.6.10 会匹配小版本 "2.x.x" eg: 2.6.10、2.7.0
~2.6.10 会匹配大版本 "2.6.x" eg: 2.6.10、2.6.0

参考
【总结】1361- package.json 与 package-lock.json 的关系

猜你喜欢

转载自blog.csdn.net/mouday/article/details/126382414