Gulp 咕噜咕噜咕噜声手表错误

Gulp 咕噜咕噜咕噜声手表错误,gulp,gulp-watch,Gulp,Gulp Watch,我试图设置我的吞咽以观察哈巴狗的变化,但我得到了以下错误,我不知道这可能是什么: events.js:141 throw er; // Unhandled 'error' event ^ SyntaxError: Unexpected token (19:0) at Parser.pp$4.raise (/../node_modules/acorn/dist/acorn.js:2221:15) at Parser.pp.unexpected (/../no

我试图设置我的吞咽以观察哈巴狗的变化,但我得到了以下错误,我不知道这可能是什么:

events.js:141
      throw er; // Unhandled 'error' event
      ^
SyntaxError: Unexpected token (19:0)
    at Parser.pp$4.raise (/../node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (/../node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (/../node_modules/acorn/dist/acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (/../node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/../node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/../node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/../node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/../node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$1.parseVar (/../node_modules/acorn/dist/acorn.js:1034:28)
    at Parser.pp$1.parseVarStatement (/../node_modules/acorn/dist/acorn.js:917:10)
我的gulpfile.js如下所示:

const gulp = require('gulp');
const pug = require('gulp-pug');    

gulp.task('pug', () =>
  gulp.src('pug/*.pug')
    .pipe(pug({ pretty: false }))
    .pipe(gulp.dest('.'))    
);

gulp.task('watch', function (){
  gulp.watch('pug/*.pug', ['pug']);
});

问题可能是
.pipe(gulp.dest('.'))
您应该指定实际的文件夹名称。e、 g.
.pipe(gulp.dest('folderName'))
/
.pipe(gulp.dest([\uu dirname])

另外,在
gulp.src('pug/*.pug')
看来

return gulp.src('pug/*.pug')
它通过包含
return
语句来避免错误


请编辑您的问题以包含您的哈巴狗文件,好吗?

问题可能是
.pipe(gulp.dest('.'))
您应该指定一个实际的文件夹名称。例如
.pipe(gulp.dest('folderName'))
/
.pipe(gulp.dest([\uu dirname])

另外,在
gulp.src('pug/*.pug')
看来

return gulp.src('pug/*.pug')
它通过包含
return
语句来避免错误


请编辑您的问题以包含您的哈巴狗文件,好吗?

第141行是哪一行?您是否有该文件夹(至少有一个哈巴狗文件)?第141行是哪一行?您是否有该文件夹(至少有一个哈巴狗文件)?