项目中需要引入 less ,执行npm install less less-loader --save

导致报错

 ERROR  [Vue warn]: Error in beforeCreate hook: "Error: Module build failed (from ./node_modules/less-loader/dist/cjs.js
):
TypeError: this.getOptions is not a function  at Object.lessLoader (E:\lesson\aliyun_blog\h5\node_modules\less-loader\dist\index.js:19:24)"

found in

是因为版本问题导致,less版本问题,卸载重新安装指定版本号
改成

"less": "^3.8.1",
"less-loader": "^4.1.0",

就可以了

标签: none

添加新评论