什么导致这种“无效的顶级表达”错误在我的GULP gulpfile.js文件? [英] What is causing this "invalid top-level expression" error in my GULP gulpfile.js file?

查看:174
本文介绍了什么导致这种“无效的顶级表达”错误在我的GULP gulpfile.js文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始喝酒后出现错误。

  [gulp-sass]源字符串:1:error:invalid top-高级表达式

gulpfile.js:

  var gulp = require('gulp'); 
var sass = require('gulp-sass');
$ b gulp.task('sass',function(){
gulp.src('app / assets / sass / styles.sass')
.pipe(sass({
errLogToConsole:true
)))
.pipe(gulp.dest('public_html / assets / css'))
});

gulp.task('default',['sass'],function(){
gulp.watch(app / assets / sass / *。sass,['sass' ]);
});

Windows 7

解决方案如果你想使用缩进语法(.sass)作为顶层文件,可以使用

pipe(sass {indentedSyntax:true}))



而不是

pipe(sass())


I get an error after I start gulp. I have taken out all other plugins to find problem:

[gulp-sass] source string:1: error: invalid top-level expression

gulpfile.js:

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

gulp.task('sass', function() {
    gulp.src('app/assets/sass/styles.sass')
        .pipe(sass({
            errLogToConsole: true
        }))
        .pipe(gulp.dest('public_html/assets/css'))
});

gulp.task('default', ['sass'], function() {
    gulp.watch("app/assets/sass/*.sass", ['sass']);
});

Windows 7

解决方案

If you want to use the indented syntax (.sass) as the top level file, use

pipe(sass({ indentedSyntax: true }))

instead of

pipe(sass()).

这篇关于什么导致这种“无效的顶级表达”错误在我的GULP gulpfile.js文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆