I have a simple Meteor project which contains only 1 page with a canvas on it. This canvas is using fabric js which was installed using:
meteor npm install --save fabric
It works when I run the app on my windows machine (fabric js works and I can draw on the canvas)
But when I deploy on ubuntu + docker it fails during node-pre-gyp install:
> node-pre-gyp install --fallback-to-build --update-binary
(node:98) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
/bin/sh: pkg-config: not found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 while in binding.gyp. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.4.0-137-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/opt/bundle/bundle/programs/server/npm/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/opt/bundle/bundle/programs/server/npm/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /opt/bundle/bundle/programs/server/npm/node_modules/canvas
gyp ERR! node -v v14.19.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok here
in my Dockerfile i'm using following versions:
- Meteor version =
2.10.0
- docker container =
geoffreybooth/meteor-base:2.10.0
- node version =
node:14.19.3-alpine
When I remove the fabric js package then I can deploy without any problems. Any ideas how to fix this?