Skip to content
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

Open
joepagan opened this issue Oct 7, 2016 · 6 comments
Open

Incompatible library version: cjpeg #23

joepagan opened this issue Oct 7, 2016 · 6 comments

Comments

@joepagan
Copy link

joepagan commented Oct 7, 2016

Hi,

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

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

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Users/username/Documents/sites/website.com/node_modules/mozjpeg/vendor/cjpeg
  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([
        "./images/tester.jpg",
    ])
    .pipe(imagemin([
        imageminMozjpeg({
            progressive: true,
            quality: 80
        })
    ]))
    .pipe(gulp.dest("./images/mozjpeg"));
});

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

@aaronbushnell
Copy link

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?

@gbiryukov
Copy link

$ brew upgrade libpng

resolved this issue for me

@xiaoyaozi1010
Copy link

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

@jdavidbakr
Copy link

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

@jdavidbakr
Copy link

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 https://github.com/glennrp/libpng
cd libpng
./autogen.sh
./configure
make
make install
cd /usr/lib64/
ln -s /usr/local/lib/libpng16.so.16
ln -s /usr/local/lib/libpng16.so

@colinodell
Copy link

Upgrading to version 7 or higher of this library resolves the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants