Karma runs on Node.js and is available as an NPM package.
Installing Node.js or iojs #
There are node.js or iojs for both Mac and Windows.
On Linux, we recommend using NVM.
Note: Karma works on the three latest stable versions of node. That is 0.8.x, 0.10.x and 0.12.x at this point. Also works on iojs 2.x.x.
Installing Karma and plugins #
The recommended approach is to install Karma (and all the plugins your project needs) locally in
the project's directory.
$ npm install karma --save-dev
$ npm install karma-jasmine karma-chrome-launcher --save-dev
This will install
karma-chrome-launcher packages into
node_modules in your current
working directory and also save these as
package.json, so that any
other developer working on the project will only have to do
npm install in order to get all these
$ ./node_modules/karma/bin/karma start
Commandline Interface #
./node_modules/karma/bin/karma start sucks and so you might find it useful to install
$ npm install -g karma-cli
Then, you can run Karma simply by
karma from anywhere and it will always run the local version.