The gulp task has problems running locally, but others’ computers are normal.

  node.js, question

The img task running on my computer is not over, but it is correct on someone else’s computer and it is useless to reinstall the plug-in.
图片描述

var gulp = require('gulp');
 var    less = require("gulp-less"),
 imagemin = require('gulp-imagemin'),
 pngcrush = require('imagemin-pngcrush'),
 minifyHtml = require("gulp-minify-html"),
 minifyCss = require("gulp-minify-css"),
 uglify = require("gulp-uglify");
 
 
 //less compilation
 gulp.task('compile-less', function () {
 gulp.src('css/*.less')
 .pipe(less())
 .pipe(gulp.dest('dist/css'));
 });
 
 //html file compression
 gulp.task('minify-html', function () {
 Gulp.src('index.html') // html file to be compressed
 . pipe(minifyHtml()) // compression
 .pipe(gulp.dest('dist/'));
 });
 //css file compression
 gulp.task('minify-css', function () {
 gulp.src('css/!  *.css') // css file to be compressed
 . pipe(minifyCss()) // compressed css
 .pipe(gulp.dest('dist/css'));
 });
 //js file compression
 gulp.task('minify-js', function () {
 var config = {
 mangle: {except: ['define','require','module','exports']},
 compress: false
 };
 Gulp.src('js/*.js') // js file to be compressed
 . pipe(uglify(config)) // use uglify for compression, please refer to:
 .pipe(gulp.dest('dist/js'));  //Compressed path
 });
 //compress pictures
 gulp.task('img', function() {
 return gulp.src('img/*')
 .pipe(imagemin({
 progressive: true,
 svgoPlugins: [{removeViewBox: false}],
 use: [pngcrush()]
 }))
 .pipe(gulp.dest('dist/img/'));
 });
 gulp.task('default',function(){
 gulp.run('compile-less', 'img', 'minify-html', 'minify-css', 'minify-js');
 
 //Monitor html file changes
 gulp.watch('*.html', function(){
 gulp.run('minify-html');
 });
 // Watch image files
 gulp.watch('img/*', ['img']);
 // Watch .css files
 gulp.watch('css/!  *.css', ['minify-css']);
 
 // Watch .js files
 gulp.watch('js/!  *.js', ['minify-js']);
 
 
 });
gulp.task('default',function(){
 gulp.run('compile-less', 'img', 'minify-html', 'minify-css', 'minify-js');

Change to

gulp.task('default',['compile-less', 'img', 'minify-html', 'minify-css', 'minify-js']);

Try