vue-storefront-api icon indicating copy to clipboard operation
vue-storefront-api copied to clipboard

npm install resulting `fatal error: glib-object.h: No such file or directory` issue

Open rafinkarki opened this issue 5 years ago • 3 comments

Followed the manual installation guide in my local machine ubuntu 18.04

  1. git clone https://github.com/DivanteLtd/vue-storefront-api.git vue-storefront-api
  2. cd vue-storefront-api
  3. npm install
  4. docker-compose up

While installing npm packages having an issue as fatal error: glib-object.h: No such file or directory I researched quite a bit and found that its something related to sharp node_modules. Can anyone help me here? export

rafinkarki avatar Apr 08 '19 15:04 rafinkarki

note from me:

sharp package requires specific versions of libvips: http://sharp.pixelplumbing.com/en/stable/changelog/

but since nothing can be found on the system that matches the requirement, it tries to build the correct libvips from source.

Docs should state clearly that either specific vips is installed or build tools should be installed on the system (and then state which build tools are required). JUST installing sudo apt-get install glib2.0-dev won't work for ubuntu OS.

janmyszkier avatar Apr 09 '19 06:04 janmyszkier

@janmyszkier could you, please, propose a PR with information you mentioned to vue-storefront docs in the Requirements of the linux installation guide?

lukeromanowicz avatar Apr 30 '19 21:04 lukeromanowicz

@lukeromanowicz selftnote to try to reproduce this today:

  • setup DO droplet with ubuntu 18.04
  • git clone https://github.com/DivanteLtd/vue-storefront-api.git vue-storefront-api
  • apt update && apt install npm && apt install docker-compose
  • cd vue-storefront-api
  • npm install
  • docker-compose up
  • apt remove libvips

I will come up with a PR once I'm able to reproduce this currently I'm getting stuck on Removing x-pack... from ES

cannot reproduce this and getting:

root@vsf-api-209:/tmp/vue-storefront-api# npm cache clean
root@vsf-api-209:/tmp/vue-storefront-api# npm rebuild sharp

> [email protected] install /tmp/vue-storefront-api/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using existing vendored libvips v8.7.0
make: Entering directory '/tmp/vue-storefront-api/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
  CXX(target) Release/obj.target/sharp/src/operations.o
  CXX(target) Release/obj.target/sharp/src/pipeline.o
  CXX(target) Release/obj.target/sharp/src/sharp.o
  CXX(target) Release/obj.target/sharp/src/utilities.o
  SOLINK_MODULE(target) Release/obj.target/sharp.node
  COPY Release/sharp.node
make: Leaving directory '/tmp/vue-storefront-api/node_modules/sharp/build'
[email protected] /tmp/vue-storefront-api/node_modules/sharp

removing system libvips and glib2.0-dev still produces same (correct) output.

janmyszkier avatar May 03 '19 17:05 janmyszkier