完全披露我在Mean Stack Mundo中相当新,
我的gulp任务看起来像这样:
gulp.task('compile:babel', () => {
return gulp.src(['**/*.es6.js', '!node_modules/**'])
.pipe(babel({optional: ['es7.decorators']}))
.pipe(gulp.dest('.'));
})
当我通过命令行运行gulp时,我收到此错误:
C:\projects\BellaMusic\source>gulp
C:\projects\\BellaMusic\source\gulpfile.js:30
gulp.task('compile:babel', () => {
^
SyntaxError: Unexpected token )
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Liftoff.handleArguments (C:\Users\Gizzmo\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)
at Liftoff.<anonymous> (C:\Users\Gizzmo\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:192:16)
at module.exports (C:\Users\Gizzmo\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\node_modules\flagged-respawn\index.js:17:3)
我不知道造成这种情况的原因或在哪里开始任何想法都会非常感激。