1

I've tried to migrate from gulp v3 to v4, according to my researches, I should change my gulpfile.js file.

So, I tried it like this:

gulp.task('clean-css', function (cb) {
    return rimraf(paths.css, cb);
});

to

gulp.task('clean-css', gulp.series(function (cb) {
    return rimraf(paths.css, cb);
}));

-----------------------------------------------------------------

gulp.task('clean', ['clean-css', 'clean-fonts', 'clean-js']);

to

gulp.task('clean', gulp.parallel('clean-css', 'clean-fonts', 'clean-js'));

-----------------------------------------------------------------

gulp.task('build-css', ['lint-css'], function () {});

to

gulp.task('build-css', gulp.series('lint-css', function () {}));

but when I write 'gulp build' I get such error

D:\Projects\Exo\exo\src\COG.SRM\node_modules\undertaker\lib\helpers\normalizeArgs.js:20 assert(flattenArgs.length, 'One or more tasks should be combined using series or parallel'); ^ AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: One or more tasks should be combined using series or parallel at normalizeArgs (D:\Projects\Exo\exo\src\COG.SRM\node_modules\undertaker\lib\helpers\normalizeArgs.js:20:3) at Gulp.series (D:\Projects\Exo\exo\src\COG.SRM\node_modules\undertaker\lib\series.js:13:14) at Object. (D:\Projects\Exo\exo\src\COG.SRM\gulpfile.js:383:24) at Module._compile (internal/modules/cjs/loader.js:936:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10) at Module.load (internal/modules/cjs/loader.js:790:32) at Function.Module._load (internal/modules/cjs/loader.js:703:12) at Module.require (internal/modules/cjs/loader.js:830:19) at require (internal/modules/cjs/helpers.js:68:18) at execute (C:\Users\SS\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-cli\lib\versioned\^4.0.0\index.js:36:18)

Could someone help me, please?

Taras
  • 45
  • 4

0 Answers0