gulp-image: Error: write EPIPE

I was using gulp-imagemin before, which worked perfectly, but wanted to give gulp-image a try. But it’s failing with a strange error.

$ gulp image
[07:07:05] Using gulpfile /Volumes/Dev/Web/Node.js/NoobGuy/gulpfile.js
[07:07:05] Starting 'image'...
[07:07:05] Finished 'image' after 14 ms
Error: write EPIPE
    at exports._errnoException (util.js:907:11)
    at WriteWrap.afterWrite (net.js:785:14)

Here’s what I have in my gulpfile.js

var image = require('gulp-image');
gulp.task('image', function(){
    gulp.src('./public/assets/images/**/*',{'base':'./public/assets/images/'})
        .pipe(image())
        .pipe(gulp.dest('./public/assets/dist/images'));
});

I was using the same code with gulp-imagemin which worked properly. Am I doing something wrong?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Also waiting for an aswer. This is frustrating.

For the record, on MacOS:

brew install libjpeg npm install --global jpegoptim-bin

I encountered this issue on Debian Stretch (9), while it was working on Jessie and Wheezy. You have to manually update the bin until there’s another solution.

sudo apt-get update sudo apt-get upgrade sudo apt-get install jpegoptim make sure you rename the jpegoptim in your node_modules folder to jpegoptim.bak or something, so you can go back if you want. You can also remove it, of course. sudo ln -s /usr/bin/jpegoptim /your/node_modules/jpegoptim-bin/vendor/jpegoptim