Good morning
Having a bit of an issue with updating sharp on the server I use for hosting my webpage.
I use a company called webfaction (not that important but may help someone) on a centos machine (centos-release-6-7.el6.centos.12.3.x86_64) without vips.
So I installed libvips manually using configure --prefix=/home/me/libs
It is installed and seems OK
Added LDPATH and LD_LIBRARY_PATH to bashrc
export LD_LIBRARY_PATH="/home/tentogive/libs/lib"
export LDFLAGS="-L$HOME/libs/lib $LDFLAGS"
Seems to work, but when I run npm install sharp I get an error message about vips not working (I think that is what its trying to tell me) and something about manual build, but could not find any more specific build. Here is the full message:
npm install sharp
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] string_decoder is also the name of a node core module.
npm WARN package.json [email protected] No repository field.
/
> [email protected] install /home/tentogive/webapps/unbrand_https/node_modules/sharp
> node-gyp rebuild
ERROR: glibc version 2.12 requires manual installation - please see http://sharp.dimens.io/en/stable/install/
gyp: Call to 'LDD_VERSION="ldd (GNU libc) 2.12
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper." node -e "require('./binding').download_vips()"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/tentogive/.nvm/v0.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "node" "/home/tentogive/.nvm/v0.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/tentogive/webapps/unbrand_https/node_modules/sharp
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 2.6.32-573.7.1.el6.x86_64
npm ERR! argv "/home/tentogive/.nvm/v0.12.2/bin/node" "/home/tentogive/.nvm/v0.12.2/bin/npm" "install" "sharp"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls sharp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/tentogive/webapps/unbrand_https/npm-debug.log
Not certain if I am barking up the wrong tree, but how can I set, force or check if npm can see the library, or does anyone know if it uses LDPATH or LD_LIBRARY_PATH?
Hello, the quickest solution here is probably to ask Webfaction for Centos 7 rather than 6 as their docs suggest it's available.
Does centos 7 come with sharp built, or why would centos7 help me?
OK, one step forward (if someone has the same issue)
If you need to tell npm where to find a package you need to use PKG_CONFIG_PATH, and it must point to where the .pc files are. In my case:
export PKG_CONFIG_PATH=/home/tentogive/lib/pkgconfig
However I found that I also need a newer gcc, so will have to update to Centos 7 anyway:)
"why would centos7 help me"
The pre-compiled libvips binary that sharp downloads and uses will "just work" with Centos 7 (as the underlying version of glibc it contains is >= 2.13).
@vrghost242 Were you able to get everything working with Centos 7?
Yes, sorry, took a while to migrate everything, but yes, builds perfectly on centos 7