You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm dropping this here before I can propose a PR (hopefully). Originally (few months ago) I made a quick attempt to build a Docker image based on Debian (node:slim) with node-zoom2 installed. Here's the problem I've faced (still facing it today):
#9 7.685 npm ERR! /bin/sh: 1: yaz-config: not found
#9 7.685 npm ERR! gyp: Call to 'yaz-config --libs' returned exit status 127 while in binding-not-win.gyp. while loading dependencies of binding.gyp while trying to load binding.gyp
#9 7.685 npm ERR! gyp ERR! configure error
#9 7.685 npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
#9 7.685 npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
#9 7.685 npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)
#9 7.685 npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
#9 7.685 npm ERR! gyp ERR! System Linux 5.15.49-linuxkit
#9 7.685 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#9 7.685 npm ERR! gyp ERR! cwd /usr/src/app/node_modules/node-zoom2
#9 7.685 npm ERR! gyp ERR! node -v v20.8.0
#9 7.685 npm ERR! gyp ERR! node-gyp -v v9.4.0
#9 7.685 npm ERR! gyp ERR! not ok
It seems that yaz-config doesn't exist (maybe it isn't shipped anymore with yaz or libyaz-dev). Instead, pkg-config yaz works and with the following trick I was able to build the image:
FROM node:slim
...
RUN \
npm install node-zoom2 --ignore-scripts \
&& LIBS=`pkg-config yaz --libs` \
&& CFLAGS=`pkg-config yaz --cflags` \
&& sed -i -E 's#"cflags": \[.+\]#"cflags": ["'"$CFLAGS"'"]#' ./node_modules/node-zoom2/binding-not-win.gyp \
&& sed -i -E 's#"libraries": \[.+\]#"libraries": ["'"$LIBS"'"]#' ./node_modules/node-zoom2/binding-not-win.gyp \
&& npm rebuild
...
I admit this isn't very clean but, as I'm no Linux/C++/Make expert, I couldn't find another (quick) solution.
So, @dengelke, if you have any recommendation to make this fit into the project I'd be very pleased to hear about it! :)
The text was updated successfully, but these errors were encountered:
I'm dropping this here before I can propose a PR (hopefully). Originally (few months ago) I made a quick attempt to build a Docker image based on Debian (
node:slim
) withnode-zoom2
installed. Here's the problem I've faced (still facing it today):It seems that
yaz-config
doesn't exist (maybe it isn't shipped anymore withyaz
orlibyaz-dev
). Instead,pkg-config yaz
works and with the following trick I was able to build the image:I admit this isn't very clean but, as I'm no Linux/C++/Make expert, I couldn't find another (quick) solution.
So, @dengelke, if you have any recommendation to make this fit into the project I'd be very pleased to hear about it! :)
The text was updated successfully, but these errors were encountered: