1

I am struggeling with the installation of node-canvas on CentOS 7.

As recommended I followed the installation instructions and executed the following commands:

sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel

afterwards I tried to install canvas with

npm install canvas

I also tried the additional options like -g and --save, but always getting the same error:

> canvas@1.6.7 install /root/node_modules/canvas
> node-gyp rebuild

Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while 
in binding.gggyp: Call to './util/has_lib.sh freetype' returned exit 
status 0 while in binding.ggyp: Call to './util/has_lib.sh freetype' 
returned exit status 0 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 
(/opt/bitnami/nodejs/lib/node_modules/npm/node_modules/node-
gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.0-693.2.2.el7.x86_64
gyp ERR! command "/opt/bitnami/nodejs/bin/.node.bin" 
"/opt/bitnami/nodejs/lib/node_modules/npm/node_modules/node-
gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/canvas
gyp ERR! node -v v8.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN root@1.0.0 No description
npm WARN root@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.6.7 install script.
npm ERR! This is probably not a problem with npm. There is likely 
additional logging output above.

I know, that this problem was already posted f.e. here

So I tried to add cairo.pc to the pkg-config search path

[root@localhost ~]# find / -name cairo.pc
 /usr/lib64/pkgconfig/cairo.pc
[root@localhost ~]# export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
[root@localhost ~]# echo $PKG_CONFIG_PATH
 /usr/lib64/pkgconfig

But I still got the same error

Also

pkg-config --atleast-version=1.12.2 cairo
echo $?

still returns 1.

VerveDev
  • 11
  • 3

0 Answers0