Atul Verma Atul Verma - 1 month ago 33
Node.js Question

ReferenceError: sass is not defined

When I configured gulp and running task for scss, I am getting Error saying ReferenceError: sass is not defined even I have installed gulp-scss and declared in gulp.js

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

gulp.task('sass', function () {
return gulp.src('app/scss/mystyles.scss')
.pipe(sass().on('error', sass.logError))

gulp.task('default', ['sass']);

Please suggest me what I am doing wrong.


You are requireing gulp-sass as scss, so either

  • change that to var sass = ..., or
  • the invocation to scss().