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'));
This is my code below . It says var sass = require('gulp-sass')(require('sass')); in the error but I am using import and none of the solution worked for me I am new to this and the cli version is 2.3.0 local version is 4.0.2 please give me a solution I am stuck here for days
import gulp from 'gulp';
import sass from 'gulp-sass';
import yargs from 'yargs';
const PRODUCTION = yargs.argv.prod;
export const styles = () => {
return gulp.src('src/assets/scss/bundle.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist/asset/css'));
}
I had this problem and found that adding the standard sass npm npm install --save-dev sass
and then adding the second section of the error message to my variable so that it looks like this const sass = require('gulp-sass')(require('sass'));
worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With