I am getting the following error in Travis-ci when using Node 4.3.2:
SyntaxError in plugin 'gulp-mocha' Unexpected token =
Everything works when using Node 6, but not 4.3.2. Here is the stack trace:
[12:05:11] Starting 'build'...
[12:05:11] Finished 'build' after 13 μs
[12:05:11] Starting 'tests'...
SyntaxError in plugin 'gulp-mocha'
Message:
Unexpected token =
Stack:
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
This is the task I am running:
gulp.task('tests', ['build'], (cb) => {
if (hasError) {
cb();
return;
}
return gulp.src('build/test/**/*.js', {read: false})
.pipe(mocha())
.on("error", handleError);
});
How can I correct this?
The older version of Node is being used, as this is an AWS Lambda application.