I was successfully able to install livips and sharp using the gist using following commands
curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
npm install sharp
on following environment
Cent OS: 6.7
NPM : 1.4.14
Node : v0.10.29
But when I include following command in the program,
var sharp = require('sharp')
I am getting following error:
module.js:356
Module._extensionsextension;
^
Error: libvips.so.42: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.module.exports.test1 (/home/as/sails/z2/api/services/TestService.js:28:17)
at Object.bound (/home/as/sails/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
at /home/as/sails/z2/api/policies/router.js:189:45
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
I tried doing ldconfig without much help
whereis vips
vips: /usr/bin/vips /usr/local/bin/vips /usr/include/vips /usr/share/man/man1/vips.1
whereis libvips
libvips: /usr/lib/libvips.a /usr/lib/libvips.la /usr/lib/libvips.so /usr/local/lib/libvips.a /usr/local/lib/libvips.la /usr/local/lib/libvips.so
That script looks a little outdated. Please can you try:
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -
(The newer Centos 7 does not require this manual installation step - see http://sharp.dimens.io/en/stable/install/#linux )
Thank you for quick turn around. When I run the script, I get
Found libvips 8.1.1
message. Should remove the current version and reinstall ?
The expected paths of the required shared libraries can be revealed by running:
ldd node_modules/sharp/build/Release/sharp.node
You might need to ensure the old version is removed first.
Following the output after running the command
linux-vdso.so.1 => (0x00007ffdb973a000)
libvips.so.42 => not found
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007fa55dc46000)
libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00007fa55da42000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa55d83a000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fa55d522000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa55d21c000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa55cf98000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa55cd81000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa55cb64000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa55c7d0000)
/lib64/ld-linux-x86-64.so.2 (0x0000003715400000)
I was able to resolve the issue by following these steps.
Added usrlocal.conf file with following line into /etc/ld.so.conf.d
/usr/local/lib
Then ran ldconfig -v as root upon save
Thank you very much for the help.
Great, glad you got it working.
The --prefix=/usr part of the preinstall.sh script means it should install to the RHEL-preferred /usr/lib location.
Most helpful comment
I was able to resolve the issue by following these steps.
Added usrlocal.conf file with following line into /etc/ld.so.conf.d
/usr/local/lib
Then ran ldconfig -v as root upon save
Thank you very much for the help.