执行./configure --prefix=/usr/local
有如下信息
cairo will be compiled with the following surface backends:
  Xlib: yes
  Quartz: no
  XCB: no
  Win32: no
  PostScript: no
  PDF: no
  glitz: nothe following font backends:
  FreeType: no
  Win32: no
  ATSUI: noand the following features:
  PNG functions: no
configure: error: Cairo requires at least one font backend.
  Please install freetype and fontconfig, then try again:
  http://freetype.org/ http://fontconfig.org/
再执行 make
如下信息
make  all-recursive
make[1]: Entering directory `/home/bss/igs/nodecanvas/cairo-1.0.2'
Making all in pixman
make[2]: Entering directory `/home/bss/igs/nodecanvas/cairo-1.0.2/pixman'
Making all in src
make[3]: Entering directory `/home/bss/igs/nodecanvas/cairo-1.0.2/pixman/src'
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I.     -g -O2 -MT fbpict.lo -MD -MP -MF ".deps/fbpict.Tpo" -c -o fbpict.lo fbpict.c; \
then mv -f ".deps/fbpict.Tpo" ".deps/fbpict.Plo"; else rm -f ".deps/fbpict.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I. -g -O2 -MT fbpict.lo -MD -MP -MF .deps/fbpict.Tpo -c fbpict.c  -fPIC -DPIC -o .libs/fbpict.o
/tmp/ccU7WdtR.s: Assembler messages:
/tmp/ccU7WdtR.s:5383: Error: symbol `_cairo_pixman_composite' is already defined
make[3]: *** [fbpict.lo] 错误 1
make[3]: Leaving directory `/home/bss/igs/nodecanvas/cairo-1.0.2/pixman/src'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/bss/igs/nodecanvas/cairo-1.0.2/pixman'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/home/bss/igs/nodecanvas/cairo-1.0.2'
make: *** [all] 错误 2

解决方案 »

  1.   

    讓你先安裝字體,裝了沒有呢?
    網上有説這是一個bug的,應該是pixman-remap.h裏面的重複定義。要不你先試試升級版本?
      

  2.   

    我换了版本可以了
    但是又出现了一个问题 编译通过
    make install的时候 有个这样的错误
    which: no gtkdoc-rebase in (/usr/java/jdk1.7.0_67-cloudera/bin:/opt/mqm/bin:./usr/java/jdk1.7.0_67-cloudera/bin:/opt/mqm/bin:./usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin/:/home/bss/bin:/usr/local/bin/)
    make[6]: [install-data-local] 错误 1 (忽略)
      

  3.   

    configure  都失败了,Cairo requires at least one font backend.缺少字体库。make[6]: [install-data-local] 错误 1 (忽略)  忽略的错误不用管。
      

  4.   

    就是缺少gtkdoc-rebase吧,看名稱是文檔,可能影響不大。
    或者你就上網下載一個咯。
      

  5.   

    [root@host03 cairo-1.10.2]# npm install canvas> [email protected] install /home/bss/igs/node_modules/canvas
    > node-gyp rebuildPackage /usr/local/lib/libpng was not found in the pkg-config search path.
    Perhaps you should add the directory containing `/usr/local/lib/libpng.pc'
    to the PKG_CONFIG_PATH environment variable
    Package '/usr/local/lib/libpng', required by 'cairo', not found
    gyp: 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 (/home/bss/igs/node_js/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
    gyp ERR! stack     at emitTwo (events.js:126:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    gyp ERR! System Linux 2.6.32-431.el6.x86_64
    gyp ERR! command "/home/bss/igs/node_js/bin/node" "/home/bss/igs/node_js/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/bss/igs/node_modules/canvas
    gyp ERR! node -v v8.12.0
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok 
    npm WARN enoent ENOENT: no such file or directory, open '/home/bss/igs/package.json'
    npm WARN igs No description
    npm WARN igs No repository field.
    npm WARN igs No README data
    npm WARN igs No license field.npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2018-10-16T06_17_21_541Z-debug.log现在是这种情况了