Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while loading shared libraries: libpng16.so.16

The problem is that I'm trying to use nodejs for building some css files from scss. On the local computer everything is ok.

When I run npm run production it shows me the error:

ERROR in ./resources/assets/sass/images/promo.jpg
Module build failed: Error: Command failed: /var/www/vhosts/site.ru/shared/node_modules/mozjpeg/vendor/cjpeg
/var/www/vhosts/site.ru/shared/node_modules/mozjpeg/vendor/cjpeg: error while loading 
shared libraries: libpng16.so.16: cannot open shared object file: No such file or 
directory

But when I run the same command from another directory(For example: /var/www/vhosts/site2.ru/) everything is ok(script works with jpg files too).

If I run ldconfig -p | grep libpng I see the next:

 libpng12.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libpng12.so.0
 libpng12.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpng12.so.0

So, my Libng12 is working correctly, why does the system needs in libpng16? And what should I try do in this situation?

My system is Ubuntu 16.04

like image 499
Pavel Avatar asked Jan 02 '23 18:01

Pavel


1 Answers

Find the solution: apt-get install libpng16-dev so, I just installed the required library.

like image 64
Pavel Avatar answered Jan 05 '23 08:01

Pavel