Module build failed (from ./node_modules/less-loader/dist/cjs.js): TypeError: this.getOptions

采用vue cli 4x 脚手架开发vue2 项目时 在安装了 less和less-loader 后,编译项目的时候提示下面问题:
Module build failed (from ./node_modules/less-loader/dist/cjs.js): TypeError: this.getOptions is not a function

经过搜索了解是less-loader的版本太高了当前是8

解决方式,降低less-loader的版本为7.3.0

npm install [email protected] --save-dev

编译解决了这个问题

你可能感兴趣的:(Module build failed (from ./node_modules/less-loader/dist/cjs.js): TypeError: this.getOptions)