dtoiu
2021-07-13 20:26
采纳率: 0%
浏览 272

前端构建工具报错gulp-sass not have a default Sass compiler

D:\HB\hello>gulp sasstask
[20:00:22] Using gulpfile D:\HB\hello\gulpfile.js
[20:00:22] Starting 'sasstask'...
Error in plugin "gulp-sass"
Message:

gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the `sass` and `node-sass` packages are permitted.
For example, in your gulpfile:

  var sass = require('gulp-sass')(require('sass'));

[20:00:22] The following tasks did not complete: sasstask
[20:00:22] Did you forget to signal async completion?

img

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • gulp sass 5没有默认的sass编译器;请自己定一个。

    “sass”和“node sass”包都是允许的。

    例如,在gulpfile中:

    var sass=require('gulp-sass')(require('sass'));

    [20:00:22]以下任务未完成:sasstask

    [20:00:22]是否忘记发出异步完成的信号?

    没有设置sass编译的插件解决方案:
    var sass = require('gulp-sass')或者(require('sass');

    点赞 评论
  • 暖子游手好闲 2021-07-22 16:49

    楼主这个问题解决了吗

    点赞 评论

相关推荐 更多相似问题