安装less后报错:Module build failed: TypeError: this.getOptions is not a function at Object.

在Vue-cli中使用lang="less"时报错:Module build failed: TypeError: this.getOptions is not a function at Object.loader (D:\WORK\VueProject\XiaoWei\node_modules\less-loader\dist\index.js:52:26)

出现这个问题的原因是less-loader版本过高,降级到5.0.0即可

 npm install less-loader@5.0.0 --save-dev

posted @ 2021-06-30 11:27  雪莉06  阅读(3206)  评论(0编辑  收藏  举报