【问题标题】:Gulp error on gulp-ruby-sass task [duplicate]gulp-ruby-sass 任务上的 Gulp 错误[重复]
【发布时间】:2015-03-25 07:58:15
【问题描述】:

这是我网站项目中的 gulpfile:

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

    sass_path = 'src/style/*.scss';

gulp.task('watch', function() {

  gulp.watch(sass_path, ['styles']);
});

gulp.task('styles', function() {

  gulp.src(sass_path)
  .pipe(sass())
  .pipe(gulp.dest('dist'));
});

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

当我尝试运行 gulp 时,它会在完成任务“样式”之前中断,并给出输出:

[15:37:00] Starting 'styles'...
[15:37:00] 'styles' errored after 1.92 ms
[15:37:00] TypeError: Arguments to path.join must be strings
    at path.js:360:15
    at Array.filter (native)
    at Object.exports.join (path.js:358:36)
    at module.exports (/opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp-ruby-sass/index.js:61:15)
    at Gulp.<anonymous> (/opt/lampp/htdocs/dev/lab/gulp/Gulpfile.js:24:9)
    at module.exports (/opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at /opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp/node_modules/orchestrator/index.js:279:18
    at finish (/opt/lampp/htdocs/dev/lab/gulp/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)

我该如何解决?

【问题讨论】:

标签: ruby sass gulp


【解决方案1】:

“gulp-ruby-sass”的语法改变了,现在是这样的:

gulp.task('styles', function() {

  return sass('src/style')
  .pipe(gulp.dest('dist'));
});

【讨论】:

  • 是的,这对我有用。
猜你喜欢
  • 1970-01-01
  • 2016-04-04
  • 1970-01-01
  • 2015-04-25
  • 2015-01-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-23
相关资源
最近更新 更多