Gulp Sass does not work

Asked

Viewed 368 times

0

So far everything worked on Gulp perfectly, except the Sass.

My Code:

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

gulp.task('styles', function(){
    gulp.src('./src/scss/**/*.scss')
    .pipe(sass())
    .pipe(gulp.dest('./src/css/'));
})

gulp.task('default', function() { 
    gulp.run('styles');
});

The error he returns to me is: Arguments to path.Join must be string

someone knows the problem? have been through this?

  • Ahh found another simpler Gulp Sass plugin that works

  • "Gulp.task('Styles', Function(){" switch to "Gulp.task('Sass', Function(){" and here "Gulp.run('Styles');" to "Gulp.run('Sass.run"');

  • I think it’s not the name the problem, I’ve done it too and it doesn’t work

  • Try using this https://www.npmjs.com/package/gulp-sass ai instead of "Gulp-ruby-Sass"

2 answers

2

  • 2

    John explains why, so the answer becomes more complete and can be more useful to others as well.

1

Using the Gulp-ruby-Sass you need to have Ruby installed on your computer and Sass Gem properly updated. Also missing add Gulp and the code to compile the files is a little different.

var gulp = require('gulp'),
    sass = require('gulp-ruby-sass');

gulp.task('styles', function(){
    sass('./src/scss/**/*.scss')
    .pipe(gulp.dest('./src/css/'));
});

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

The Gulp-Sass, that uses libsass instead of Ruby, does not need anything installed on the computer and works exactly the way you wrote.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.