安装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

上一篇:出现TypeError: Cannot assign to read only property ‘jsx‘ of object ‘#‘


下一篇:Uncaught TypeError: $(...).attr(...) is undefined