OptiPNG 0.6.4だとgruntのimageminでエラーが出る

環境

  • grunt ~0.4.4
  • grunt-cli ^1.2.0
  • grunt-contrib-imagemin ~0.7.0

経緯

CircleCIのUbuntu12上でgruntを実行したら以下のようなエラーが出た。

Running "imagemin:dynamic" (imagemin) task
Warning: Command failed: ** Error: Lossy operations are not currently supported

どうもOptiPNG 0.6.4が入っていると発生する模様。
0.7系に上げれば良いようだが、削除しといてもいいらしいので、circle.ymlを編集して依存性解決時のpreで削除するようにした。 Ubuntu14を使うようにしても、OptiPNG自体が新しいから回避出来る感。

dependencies:
  pre:
    # avoid build failure of frontend
    - echo 'removing optipng'
    - sudo apt-get remove optipng

参考

subdigit.com