canviz, jake and npm

I wanted to play with canviz ( to play around with graphviz and javascript.

It’s still not clear what I’ll be able to do quickly with it but first I needed to install it.

I first tried from the source tar ball provided on the web site ( This led to many issues that I’m provided here below. The outcome is that after an hour, I could not install it. So, I decided to start from the SVN,

svn checkout canviz-read-only

and again no success: the javascript somehow was not working. The old version from the examples worked but not the new ones (see below). Finally, I found a link to the GIT repo and with that version, it worked out of the box:

git clone


Installing canviz from the source using npm and jake

!! This did not work at the end but some information here below could be useful.

In order to install canviz from the source, you need to install jake. But before, you need another tool called npm, an executable installed with Node.js (

tar xvfz node-v0.10.17.tar.gz
cd node-v0.10.17
sudo make install

Then, you can either install jake from the source file or using npm, which I realised later on. So, here is what I did to install jake from the source. First, get the source file from

# installing jake 
git clone git://
cd ./jake
sudo make install

Then, you can come back to the canviz installation from source.

Just type the following command in the canviz directory:


I got this error:

[prompt] jake
jake aborted.
Error: Cannot find module 'browserify'
    at Function.Module._resolveFilename (module.js:338:15)
(See full trace by running task with --trace)

Here, a module is missing. You can install missing modules with npm:

npm install browserify

There are a couple of other modules to install. There was not problem except canvas:

make: Entering directory `/home/cokelaer/Downloads/canviz-read-only/node_modules/canvas/build'
  CXX(target) Release/
In file included from ../src/
../src/PNG.h: In function ‘cairo_status_t canvas_write_png(cairo_surface_t*, png_rw_ptr, void*)’:
../src/PNG.h:139:10: error: ‘CAIRO_FORMAT_RGB30’ was not declared in this scope
make: *** [Release/] Error 1
make: Leaving directory `/home/cokelaer/Downloads/canviz-read-only/node_modules/canvas/build'

Here the solution was to install a specific version of canvas as specified in the file package.json.

npm install canvas@1.0.4

Some references:

Please follow and like us:
This entry was posted in Computer Science and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.