Cannot run gulp watch with the npm 5


#1

Hi there!

Following the gulp course, I can’t run the watch task with the latest version of npm.

I have the as as below:

gulp.task('watch', function() {
console.log('The watch task is running.');
require("./server.js");
gulp.watch('./public/scripts/**/*.js', ['scripts']);    });

When running the gulp-watch I’m getting this error.

Error: watching ./public/scripts/**/*.js: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)
at Gulp.watch (/Gulp/node_modules/gulp/index.js:28:11)
at /Gulp/gulpfile.js:34:10
at taskWrapper (/Gulp/node_modules/undertaker/lib/set-task.js:13:15)
at bound (domain.js:395:14)
at runBound (domain.js:408:12)
at asyncRunner (/Gulp/node_modules/async-done/index.js:55:18)
at process.internalTickCallback (internal/process/next_tick.js:70:11)

What I’m missing here?

Thoughts?

TA