make: Entering directory '/var/www/videomail/staging/source/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:25:0:
/usr/local/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
#include <glib-object.h>
^~~~~~~~~~~~~~~
compilation terminated.
sharp.target.mk:120: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: Leaving directory '/var/www/videomail/staging/source/node_modules/sharp/build'
make: *** [Release/obj.target/sharp/src/common.o] Error 1
Hello, the presence of /usr/local/include/vips suggests libvips has been compiled from source on this machine.
http://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball
The glib2.0-dev dependency is probably missing.
You might also like to upgrade to sharp v0.20.0, which should remove the need for compilation.
already have bumped to .20 and this is where the above is happening
you saying i should apt-get install glib2.0-dev?
Sharp will be built from source at install time when a globally-installed libvips is detected http://sharp.pixelplumbing.com/en/stable/install/
You can either:
glib2.0-dev) and let sharp compile and link itself against that version of libvips, ori already had glib2.0-dev installed
michael.heuberger@binarykitchen /v/log ❯❯❯ sudo apt-get install glib2.0-dev
[sudo] password for michael.heuberger:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libglib2.0-dev-bin' for regex 'glib2.0-dev'
Note, selecting 'libglib2.0-dev' for regex 'glib2.0-dev'
libglib2.0-dev is already the newest version (2.54.1-1ubuntu1).
libglib2.0-dev-bin is already the newest version (2.54.1-1ubuntu1).
libglib2.0-dev-bin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
yet sharp failed to build
Does glib-object.h exist?
$ locate glib-object.h | grep usr
/usr/include/glib-2.0/glib-object.h
Is pkg-config aware of the path it exists at?
$ pkg-config --cflags vips-cpp
-pthread -I/usr/local/include -I/usr/include/glib-2.0 ...
dont have the locate command here on ubuntu 17.10
The find command is also suitable here, albeit a lot slower due to the lack of an index.
$ find /usr -name glib-object.h
/usr/include/glib-2.0/glib-object.h
thanks... so yes it exists
~ ❯❯❯ find /usr -name glib-object.h
/usr/include/glib-2.0/glib-object.h
and no, pkg-config isn't aware of it
~ ❯❯❯ pkg-config --cflags vips-cpp
Package vips-cpp was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips-cpp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vips-cpp' found
Please can you try that second command with the same PKG_CONFIG_PATH as sharp uses, to include /usr/local/...:
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig pkg-config --cflags vips-cpp
My best guess is that there's one or more (partial?) installations of libvips that are conflicting.
nope that wont work either
~ ❯❯❯ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig pkg-config --cflags vips-cpp
Package vips-cpp was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips-cpp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'vips-cpp' found
and yes, on the server i have two nodejs projects running both using your package (local installs)
I'd suggest ether re-installing libvips or totally removing it. Without looking at the machine I'm unlikely to be able to help further. Good luck!
same error on ubuntu 16.04 with libvips-dev and glib dev installed, also file exists in fs
If using a globally-installed libvips (e.g. via the libvips-dev package), please ensure it meets the minimum required version of libvips for a given version of sharp.
http://sharp.pixelplumbing.com/en/stable/changelog/
For example, sharp v0.20.x requires libvips v8.6.1+ but the most recent Ubuntu package is v8.4.5.
fyi I see this issue on mac osx as well. brew update vips resolved.
Thanks for the additional reports. This appears to only impact those using v0.20.0 with an globally-installed libvips that does not meet the minimum required version. I have an idea about how to improve the installation experience in this scenario.
Commit 48c5f86 should make the installation experience a little smoother - this will be in v0.20.1.
What is the timeframe for v0.20.1? Thank you in advance
v0.20.1 now available, thank you for the feedback.
Most helpful comment
fyi I see this issue on mac osx as well.
brew update vipsresolved.