Gulp – A Weblog of Priyank Maniar https://priyank.rocks Articles on web development & mobile app development Sun, 22 May 2022 08:36:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 Manually upgrade gulp from version 3 to 4 (Super Easy Guide with Examples) https://priyank.rocks/upgrading-gulp-from-3-to-4/ Fri, 20 May 2022 12:01:24 +0000 https://priyank.rocks/?p=9018 The error that I was getting: ReferenceError: primordials is not defined

The guide that convinced me for the upgrade.

A few things to remember prior making the conversion, the task should be defined in advance. In other words, if we are referring the task first and let’s say it is defined in the later lines. That’s not going to work.

Most likely you would then see errors like the following

AssertionError [ERR_ASSERTION]: Task never defined: sass

Gulp 3

1
gulp.task('default', ['sass', 'scripts']);

Gulp 4

1
gulp.task('default', gulp.series('sass', 'scripts'));

Gulp 3

1
2
3
gulp.task('scripts', function () {

});

Gulp 4

1
gulp.task('scripts', gulp.series(function () {

Gulp 3

1
2
gulp.task('git-check', function (done) {
});

Gulp 4

1
2
gulp.task('install', gulp.series('git-check', function () {
}))
]]>