Node.js imagemin on CentOS

Sean picture Sean · Apr 29, 2015 · Viewed 11.9k times · Source

I am trying to use Node.js imagemin to compress a lot of images on my server. I like using imagemin because I know how to point it at specific directories.

I am using CentOS 6 and when I run my file, I get the error:

node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin/vendor/pngquant: /lib64/libc.so.6: version `GLIBC_2.14' not found

Also, when I installed imagemin with npm install imagemin, I got an error that said:

Error: pngquant failed to build, make sure that libpng-dev is installed

Any ideas on what I can do to solve this?

Answer

bardzusny picture bardzusny · Apr 29, 2015

(Problem de facto already solved in the comments - but for the sake of completion and future generations I'm posting an actual answer).

Error: pngquant failed to build, make sure that libpng-dev is installed

This error means that the system is lacking libpng development library, which is needed to install imagemin Node.JS module. To install it on CentOS 6, you need to issue this command:

yum install libpng-devel

Please note that both package manager (here - yum) and package name (libpng-devel) can vary between different Linux distributions.