I have error 'Did you forget to signal async completion'?

[09:26:53] The following tasks did not complete: less
[09:26:53] Did you forget to signal completion of the async?

const gulp = require('gulp');
const less1 = require('gulp-less');

function less() {
 return gulp.src('./less/*.less')
.pipe(less1())
.pipe(gulp.dest('./css/'))
}

gulp.task('less', less1);


By the way, if you call less variable, it does not work task. Why?
March 20th 20 at 11:42
1 answer
March 20th 20 at 11:44
You have a function called less, and you're in the Tusk trigger the feature less1.
Here ispravlenie code...

const
 gulp = require('gulp'),
 less1 = require('gulp-less');

function less() {
 return gulp.src('./less/*.less')
.pipe(less1())
.pipe(gulp.dest('./css/'))
}

gulp.task('less', less);


When a variable is called less does not work because when the function call function less, less, js doesn't know to call the function less (
function less() {...}
), or connected less (
const less = require('gulp-less')
).

If you want to call a variable less, and that everything worked, use this code:
const
 gulp = require('gulp'),
 less = require('gulp-less');

gulp.task('less', () => {
 return gulp.src('./less/*.less')
.pipe(less())
.pipe(gulp.dest('./css/')
});

Find more questions by tags LessGulp.js