D
D
Dmitry Lokshin2017-04-19 17:39:08
JavaScript
Dmitry Lokshin, 2017-04-19 17:39:08

Why gulp error?

Good evening friends.
The gulpfile has this tack:

gulp.task('imagemin', function() {
  return gulp.src('app/img/**/*')
    .pipe(cache(imagemin({
      interlaced: true,
      progressive: true,
      svgoPlugins: [{removeViewBox: false}],
      use: [pngquant()]
    })))
    .pipe(gulp.dest('dist/img')); 
});

which takes images and optimizes them. Previously, there were no problems, but recently such an error appeared:
22e981e64f664c46ab841cd0ea210da5.png
Moreover, it occurs only when svg images appear in the img folder, although there were no such problems before.
I tried to remove the gulp-cache plugin, but exactly the same error appears only with an indication of an error in the gulp-imagemin plugin.
Didn't change anything. Tried updating the packages but to no avail.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yustas Alexu, 2017-04-19
@Ddmitrich

Try updating node.js to version 6 or higher.

S
sergey, 2017-04-20
@zorro76

A problem with

svgoPlugins: [{removeViewBox: false}]
, arose after updating imagemin-svgo to version 5.2.1
gulp-imagemin stopped processing svg files.
And if you google, you will find many similar cases on the net. For example , here's
The solution is simple: roll back imagemin-svgo in your assembly to the previous version 5.2.0 and everything will be ok.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question