使用const sass = require('gulp-sass')导入了sass转换模块,但在执行gulp命令时报错了 ---------------------------
Error in plugin "gulp-sass"
Message:
gulp-sass no longer has a default Sass compiler; please set one yourself.
Both the "sass" and "node-sass" packages are permitted.
For example, in your gulpfile:
const sass = require('gulp-sass')(require('sass'));
[14:21:11] The following tasks did not complete: sassHandler
[14:21:11] Did you forget to signal async completion?
---------------------------
其实解决办法在错误提示的位置已经给出了
const sass = require('gulp-sass')(require('sass'))
原因是gulp sass不再提供默认的sass编译器,需要另行配置,并且如果没有sass编译包的话还需要下载,方式如下