Atul Verma Atul Verma - 1 year ago 382
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.

Answer Source

You are requireing gulp-sass as scss, so either

  • change that to var sass = ..., or
  • the invocation to scss().
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download