Gulp:Object#<file>没有方法&#39; isNull&#39; </file>

时间:2014-12-08 20:14:42

标签: javascript gulp gulp-sass gulp-concat

我从gulp-concat和gulp-sass获得TypeError: Object #<File> has no method 'isNull'

gulp.task('scripts', function() {
    var dest = BUILD_DEST + 'scripts';
    del(dest);

    return gulp
        .src( scripts ) // scripts = [].concat(VENDOR_LIBS, APP_FILES)
        .pipe( plumber() )
        .pipe( concat('script.js') ) // everything is fine when this line is removed
                                     // Does the output file need to already exist?
        .pipe( gulp.dest( dest ) );
});

gulp.task('styles', function() {
    var dest = BUILD_DEST + 'styles';
    del(dest);

    return gulp
        .src( STYLE_FILES ) // STYLE_FILES = APP_SRC+'styles/*.scss'
        .pipe( plumber() )
        .pipe( sass() )
        .pipe(gulp.dest( dest ));
});

1 个答案:

答案 0 :(得分:2)

这是由于意外使用旧版本的gulp(3.0.0 vs 3.8.10),这与gulp-concat和gulp-sass不兼容。升级到版本3.8.10解决了这个问题。