M
M
Minskiy_Orakul2021-10-12 22:03:11
css
Minskiy_Orakul, 2021-10-12 22:03:11

Gulp-sass not working, what's the problem?

var gulp = require('gulp');
var rename = require('gulp-rename');
var sass = require('gulp-sass')
function conv(done) {
gulp.src('./scss/style.scss')
.pipe(sass({
errorLogToConsole: true
}))
.on('error', console.error.bind(console))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./css/'));
done()
}
gulp.task(conv)

Throws an error:
[21:53:14] Using gulpfile D:\#www\gulpfile.js
[21:53:14] Starting 'conv'...
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'));

[21:53:14] The following tasks did not complete: conv
[21:53:14] Did you forget to signal async completion?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dubrovin, 2021-10-13
@alekcena

Here is the problem, it is described and the causes are shown in the 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'));

It's in google translator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question