Search code examples
yeomanimagemin

Yeoman: Cannot find 'imagemin-jpegtran'


I've been searching a solution for this error for over a week and cannot find anything. I can't build my dist package on Yeoman due to this imagemin-jpegtran

I tried to upload an image to show the error and make things easier but Stackoverflow doesn't allow me due to reputation (no idea what reputation has to do with images... but anyway...).

This is the error:

Running "concurrent:dist" (concurrent) task
Warning: Loading "imagemin.js" tasks... ERROR

Error: Cannot find module 'imagemin-jpegtran'
Warning: Task "imagemin" not found. Use --force to continue

Aborted due to warnings. Use --force to continue
Aborted due to warnings.

Solution

  • Ok I found a solution. You have to upgrade to the latest version of grunt-contrib-imagemin.

    For that I did

    npm uninstall --save-dev grunt-contrib-imagemin 
    

    and then

    npm install --save-dev grunt-contrib-imagemin