New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible library version: cjpeg #23

joepagan opened this Issue Oct 7, 2016 · 5 comments


None yet
5 participants

joepagan commented Oct 7, 2016


I'm trying to run mozjpeg with gulp, but I get this error:

[00:13:17] Starting 'minify-jpgs'...

      throw er; // Unhandled 'error' event
Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Users/username/Documents/sites/
  Reason: Incompatible library version: cjpeg requires version 36.0.0 or later, but libpng16.16.dylib provides version 27.0.0

    at ChildProcess.exithandler (child_process.js:203:12)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

It manages to install ok, here is my task in full:

gulp.task("minify-jpgs", function(){
    return gulp.src([
            progressive: true,
            quality: 80

I am not sure what to do about this, can't find a similar issue anywhere. Do you have any suggestions?


This comment has been minimized.

aaronbushnell commented Mar 30, 2017

Getting the same error, but not when using Gulp. It turned out that installing libpng via Homebrew corrected it.

brew install libpng

However, I'm not sure why this is happening. Does this package not also include this utility?


This comment has been minimized.

gbiryukov commented Jun 21, 2017

$ brew upgrade libpng

resolved this issue for me


This comment has been minimized.

xiaoyaozi1010 commented Jan 8, 2018

$ brew install libpng
$ brew update libpng
It's resolved, but the resolution is too inferior...


This comment has been minimized.

jdavidbakr commented Mar 1, 2018

I'm getting this on an EC2 server, brew is not an option and I do have the latest libpng installed.


This comment has been minimized.

jdavidbakr commented Mar 1, 2018

This is how I solved this issue on EC2, it seems that the proper version of libpng is not installed via yum. Downloading and compiling from source gives me the library I need.

git clone
cd libpng
make install
cd /usr/lib64/
ln -s /usr/local/lib/
ln -s /usr/local/lib/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment