Closed sweetsamy21 closed 5 years ago
libpng-dev
is a linux package. It is required to build/compile the binary executable of pngquant
on your production box during the package's installation phase. This binary executable is re-built at every fresh installation of a version the npm package because it uses native OS C++ bindings to fully optimize the minification process.
You may look up the docs of your deployment machine's OS flavour for whichever package manager is used to install the libpng-dev
package before you try to install this lib via npm.
For example:
On CentOS/RHEL, you'd use yum
package manager, like sudo yum install libpng-dev
, wait for it to complete, then do npm install
.
On Ubuntu, you'd use sudo apt install libpng-dev
, then npm install
.
Also try to restart your machine after installing the libpng-dev
package - this helped in my case.
reboot it worked for me <3 !
I upgraded ubuntu, and upgraded npm and node. Then it worked just fine.
I am not sure it is related but the problem was solved for me after adding .dockerignore with node_modules
Hi there,
I installed the above plugin and used it in my gulp task to minify images. works like a charm on my local machine. When I deploy the same code in production environment, I get the following issues. Please help...!!
/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
Error: pngquant failed to build, make sure that libpng-dev is installed
Do I have to add another npm like libpng-dev in my package.json?