Answer the question
In order to leave comments, you need to log in
When trying to run gulp sass bash throws a typeerror: gulp.task is not a function. What is the reason?
The reason was a typo - I assigned var gulp twice, instead of var gulp and var sass.
When trying to run gulp sass through the bash, the following error is generated:
gulp.task('sass', function () {
^
TypeError: gulp.task is not a function
at Object.<anonymous> (C:\Users\Jeddid\Documents\!important\mysassa\sass1\gulpfile.js:6:6)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Liftoff.handleArguments (C:\Users\Jeddid\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)
at Liftoff.<anonymous> (C:\Users\Jeddid\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:198:16)
var gulp = require('gulp');
var gulp = require('gulp-sass');
gulp.task('sass', function(){
return gulp.src('source-files')
.pipe(sass()) // Using gulp-sass
.pipe(gulp.dest('destination'))
});
Answer the question
In order to leave comments, you need to log in
//var gulp = require('gulp-sass');
var sass = require('gulp-sass');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question