Klathmon / imagemin-webpack-plugin

Plugin to compress images with imagemin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install is broken by pngquant-bin dependency

anthonyaam opened this issue · comments

I'm getting the below error when running npm install imagemin-webpack-plugin.

pngquant failed to build, make sure that libpng is installed

This pngquant-bin issue describes the problem in the pngquant-bin dependency.

Unfortunately this is a problem with pngquant and not something I can fix.

However, I did just update an old branch named no-default-plugins that you can use as a workaround until pngquant fixes their stuff.

You should include it in your package.json like this:

"imagemin-webpack-plugin": "Klathmon/imagemin-webpack-plugin#no-default-plugins"

You will need to manually install any plugins you want yourself and put their options in the plugins option in this webpack plugin in order for anything to be optimized/compressed.

Don't rely on this branch sticking around for a long time though, or ever getting updated. If you are going to use this long-term, i'd recommend forking this repo and pointing to the no-default-plugins on your fork so that my changes to this branch don't break your setup again.

Even though the code fix will be outside of imagemin-webpack-plugin, I would suggest keeping this issue open while users are unable to npm install imagemin-webpack-plugin so that other users can find these instructions.

Fair enough! I won't really be checking back on it all that often though, so if someone notices that this is fixed ping me here so I can close this and update anything that's needed.

Version 6.0.0 of imagemin-pngquant was released. Maybe it fixes this issue? If so, updating the dependency would be nice (I guess a PR for that would be overkill...?).

I'll update it later today and see if it solves the problem, thanks for the heads up!

And a PR is never overkill!

@anthonyaam version 2.2.0 of this plugin was published that upgrades imagemin to version 6. Can you give it a try at some point and see if it solves your issues? Thanks!

@Klathmon I change imagemin-webpack-plugin version to 2.2.0, and npm install, still it trys to install pngquant-bin@5.0.1 and failed, I don't know why.