image-webpack-loader icon indicating copy to clipboard operation
image-webpack-loader copied to clipboard

ubuntu 16.10 libpng12.so.0: cannot open shared object file

Open capaj opened this issue 9 years ago • 8 comments

Running on: "image-webpack-loader": "^3.2.0", I always get these errors:

Error in ./images/chat-sprite.png
Module build failed: Error: /home/capaj/git_projects/be/chat-window/node_modules/pngquant-bin/vendor/pngquant: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
 @ ./styles/main.less 6:22437-22473 6:23930-23966 6:28534-28570 6:32673-32709 6:34586-34622 6:36817-36853 6:37912-37948

I researched a bit and tried installing

sudo apt-get install libpng12-0
sudo apt-get install libpng-dev

I eve tried sudo apt install pngquant but no luck. Has anyone been able to make this work on latest ubuntu?

capaj avatar Feb 16 '17 14:02 capaj

encounter with the same issue

timur-orudzhov avatar Feb 20 '17 15:02 timur-orudzhov

Closing because this is a yarn issue. So when I did:

npm i image-webpack-loader pngquant

it works fine. Seems like yarn is not able to execute the postinstall npm script correctly. @timur-orudzhov are also on yarn? or NPM?

capaj avatar Feb 20 '17 15:02 capaj

@capaj on npm

timur-orudzhov avatar Feb 20 '17 15:02 timur-orudzhov

I'm having the same issue, even with that trick https://github.com/tcoopman/image-webpack-loader/issues/76#issuecomment-281109236 mentioned. Weirdly it works on my local machine but not on docker build.

enapupe avatar Mar 08 '17 01:03 enapupe

Well. My issue was actually my mistake and might be yours if you are using docker. I was replacing docker's node_modules folder when running COPY . /usr/app so the local binary was linked to this lib that obviously wasn't available at the docker machine. Simple adding node_modules to .dockerignore fixed it.

enapupe avatar Mar 08 '17 13:03 enapupe

So apparently its an issue with later versions of Ubuntu - see https://askubuntu.com/a/895903/250605. @capaj

maraisr avatar Apr 30 '17 20:04 maraisr

I had this issue, but I happed to have missing automake sudo apt-get install automake

After, it works both with yarn and npm

yarn --version
0.24.5

magiccookie avatar Jun 05 '17 11:06 magiccookie

@enapupe Cheers, you helped solve my issue! I had placed the node_modules in my dockerignore file, but when mounting the root project directory the node_modules where added back in. So I mounted my projects src directory instead.

Jason-Cooke avatar Jun 17 '18 06:06 Jason-Cooke