Install canvas on Ubuntu 10.04

Steps for installation of canvas on Ubuntu 10.04


sudo apt-get install libcairo2-dev

Download jpeg library. At the time of writing it was available here
Unpack the downloaded file. Will be in a folder jpeg-8c.


cd jpeg-8c
./configure --prefix=/usr/local
sudo make install

Once this is done install canvas

npm install canvas

That’s it. Check out a few examples and you’re done.

Posted in Node.js | Tagged , , | Leave a comment

Understanding npm module installation

npm will install packages locally, in ./node_modules. So if you are in /home/foo:

user@host:/home/foo$ npm install Haraka
Haraka will be installed in /home/foo/node_modules/Haraka. If you want to install a module globally (by default in /usr/local/lib/node_modules), supply the -g switch:

user@host:/home/foo$ sudo npm install -g Haraka
Haraka will be installed in /usr/local/lib/node_modules/Haraka, and the command haraka will be symlinked to /usr/local/bin/haraka.

It’s recommended that any dependencies be installed locally. This way, you never have to bother with different packages requiring different versions of their dependencies, aka “dependency hell”. I have all my projects in ~/development/projects, and each node project has it’s own node_modules folder.

Posted in Node.js, npm | Leave a comment

Installing another version of Node

Steps for uninstalling one version of node and installing another:

make uninstall
git remote add upstream git://githuib.com/joyent/node.git
git fetch -a upstream
git checkout v0.6.11
./configure && make && sudo make install

Posted in Node.js, Ubuntu How To | Tagged | Leave a comment