Error Message while running Bench update - cairo not found

Hello Team

Please i need a quick fix on this error message while updating Bench

INFO:bench.utils:npm install

canvas@1.6.9 install /home/ubuntu/frappe-bench/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.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/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:308:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 3.13.0-103-generic
gyp ERR! command “/usr/bin/nodejs” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /home/ubuntu/frappe-bench/node_modules/canvas
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm ERR! Linux 3.13.0-103-generic
npm ERR! argv “/usr/bin/nodejs” “/usr/bin/npm” “install”
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! canvas@1.6.9 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.9 install script ‘node-gyp rebuild’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs canvas
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/.npm/_logs/2018-02-02T14_36_39_871Z-debug.log
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
File “/home/ubuntu/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/bench-repo/bench/commands/update.py”, line 58, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, force=force, reset=reset)
File “/home/ubuntu/bench-repo/bench/commands/update.py”, line 75, in _update
update_npm_packages(bench_path=bench_path)
File “/home/ubuntu/bench-repo/bench/utils.py”, line 460, in update_npm_packages
exec_cmd(‘npm install’, cwd=bench_path)
File “/home/ubuntu/bench-repo/bench/utils.py”, line 142, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: npm install

Looks to me like an npm package called cairo is missing. Try and install it manually.

Thank you for coming through

I have attempted to innstall maunally with no luck… Can you please share a tip on how to… ?

cairo seems to refer to a apt package and not an npm package

node.js - Package cairo was not found in the pkg-config search path. Node j.s install canvas issue - Stack Overflow

frappe@erpnext:~/frappe-bench$ sudo apt list --installed | grep cairo

WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts.

libcairo-gobject2/trusty-updates,now 1.13.0~20140204-0ubuntu1.1 i386 
[installed,automatic]
libcairo2/trusty-updates,now 1.13.0~20140204-0ubuntu1.1 i386 [installed,automatic]
libpangocairo-1.0-0/trusty-updates,now 1.36.3-1ubuntu1.1 i386 [installed,automatic]