imagemin / cwebp-bin

cwebp bin-wrapper that makes it seamlessly available as a local dependency
https://developers.google.com/speed/webp
MIT License
91 stars 36 forks source link

cwebp-bin error on fresh install #31

Closed skywickenden closed 5 years ago

skywickenden commented 5 years ago

I'm just copying this issue from imagemin-webp as the source of the problem was here.

The problem is fixable with the actions below, but thought it would be good to put here for anyone else encountering this problem as it is valid for any library using cwebp-bin, such as webp-converter


I'm getting the following error on a fresh installation.

/path/to/root/node_modules/cwebp-bin/vendor/cwebp: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

imagemin-webp is implemented as follows:

  (async () => {
    const files = await imagemin([file], outputDirectory, {
        use: [
            imageminWebp({quality: 90})
        ]
    });
  })();

I've triple checked that both file and outputDirectory are valid - and they work fine if I use imagemin without imageminWebp.

OS is Ubuntu 18.04. Any suggestions?


I solved this by installing the following missing libraries:

apt-get install libglu1
apt-get install libxi6 libgconf-2-4
ldconfig

No idea why they are missing. This Ubuntu server is pretty vanilla.

dawsbot commented 4 years ago

I had this in a docker container today and the fix was to add this before the npm install in our Dockerfile:

RUN apt-get update && apt-get install -y libglu1
YevhenKholevchuk2016 commented 4 years ago

Hello everyone. Faced the exact same problem. /path/to/root/node_modules/cwebp-bin/vendor/cwebp: cannot execute binary file OS is macOS 10.15.5. Any suggestions?

pr0xyMity commented 3 years ago

I'm just copying this issue from imagemin-webp as the source of the problem was here.

The problem is fixable with the actions below, but thought it would be good to put here for anyone else encountering this problem as it is valid for any library using cwebp-bin, such as webp-converter

I'm getting the following error on a fresh installation.

/path/to/root/node_modules/cwebp-bin/vendor/cwebp: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

imagemin-webp is implemented as follows:

  (async () => {
    const files = await imagemin([file], outputDirectory, {
      use: [
          imageminWebp({quality: 90})
      ]
    });
  })();

I've triple checked that both file and outputDirectory are valid - and they work fine if I use imagemin without imageminWebp.

OS is Ubuntu 18.04. Any suggestions?

I solved this by installing the following missing libraries:

apt-get install libglu1
apt-get install libxi6 libgconf-2-4
ldconfig

No idea why they are missing. This Ubuntu server is pretty vanilla.

Do you know which packages this needs on node alpine? image

neo commented 2 years ago

just solved a similar issue in an alternative way:

if you're using docker or "stretch" debian (which is the default docker tagged version for node:14 and below), consider using "bullseye" or "buster" instead as it has a newer version of zlib (1.2.11 v.s. 1.2.8): https://packages.debian.org/bullseye/zlib1g

vipul-nema commented 1 year ago

ERROR in spawn /opt/node_app/app/node_modules/cwebp-bin/vendor/cwebp ENOENT

Facing same issue in docker apline image for node 16.15.1. If we run build locally in ubuntu then it works fine.

CodeLit commented 1 year ago

I have similar problem:

image image image