0

I am trying to install the npm package node-canvas. It does not work. This is (an extract of) the error message that I get in my console.

Could someone please help me to interpret these errors? I already tried re-installing properly node-pre-gyp and node-gyp globally. That worked fine (= without any errors), by the way.

npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Failed to execute '/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=/Users/dwehsarg/Development/pdf-test4/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/dwehsarg/Development/pdf-test4/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
bassman21
  • 320
  • 2
  • 11

1 Answers1

0

Finally, I was able to solve the problem. It appears that the root cause was that "Cairo" was not properly installed. It did install it with

brew install pkg-config cairo pango libpng jpeg giflib librsvg

But maybe there was a typo or something else did not work properly.

I reinstalled all dependencies of "node-canvas" one by one with "brew". After that, installing "node-canvas" with npm install canvas worked fine.

bassman21
  • 320
  • 2
  • 11