imagemin / imagemin-pngquant

Imagemin plugin for `pngquant`
MIT License
316 stars 81 forks source link

Error EPIPE #68

Open jellohouse opened 4 years ago

jellohouse commented 4 years ago

I'm getting this error using imageminPngquant: errno: 'EPIPE', code: 'EPIPE', syscall: 'write', originalMessage: 'write EPIPE', shortMessage: 'Command failed with EPIPE:

And my code looks simply like this:

const imagemin = require('imagemin');
const imageminPngquant = require('imagemin-pngquant');
...
imagemin([filePath], {
      destination: path.join('images/build'),
      plugins: [
        imageminPngquant()
      ]
    })
    .then(files => {
      console.log(files);
    })
    .catch(err => {
      console.log("Error compressing", err);
    });

If I remove the imageminPngquant and leave the plugins section empty, the images do go to the destination properly but without any compression.

What could cause this issue? Any help would be greatly appreciated!

gnitnuj commented 3 years ago

Try checking your memory and/or timeout settings for your Lambda. I was able to resolve the intermittent EPIPE errors I was seeing after increasing both. It is likely due to insufficient memory, but I'm mentioning both just in case. Also for reference I was running Node 12 & I had the ImageMagick layer.