Many problems occurred during karma startup: 1. to install karma, you must first install nodejs and npm before installing karma. for the installation process of nodejs and npm, refer to the article: Angularjs learning --- establish the angularjs environment, and install nodejs, npm, and karma 2 under ubuntu 12.04. install karma step karma official tutorial 1 ). run the following command: npm install-g karma2 ). install karma-cli $ npm Install-g karma-cli3) install plug-ins: # Install plugins that your project needs: $ npm install karma-jasmine karma-chrome-launcher -- save-dev3.karma startup settings and error handling start karma: karma start reports the following error: Copy code Amosli @ amosli-pc :~ /Develop/angular-phonecat $ karma start module. js: 340 throw err; ^ Error: Cannot find module 'zeparser 'at Function. module. _ resolveFilename (module. js: 338: 15) at Function. module. _ load (module. js: 280: 25) at Module. require (module. js: 364: 17) at require (module. js: 380: 17) at Object. <anonymous> (/home/amosli/develop/angular-phonecat/node_modules/karma/node_modules/socket. io/node_modules/socket. io-client/ Node_modules/active-x-obfuscator/index. js: 1: 78) at Module. _ compile (module. js: 456: 26) at Object. module. _ extensions .. js (module. js: 474: 10) at Module. load (module. js: 356: 32) at Function. module. _ load (module. js: 312: 12) at Module. require (module. js: 364: 17) copy the code solution: sudo npm install zeparser because zeparser is not installed. Just install it. karma init generates karam. conf. js, we need to modify: files and exclude variables to copy the code module. exports = function (c Onfig) {config. set ({basePath: '', frameworks: ['Jasmine '], files :['*. js'], exclude: ['karma. conf. js'], reporters: ['progress'], port: 9876, colors: true, logLevel: config. LOG_INFO, autoWatch: true, browsers: ['chromi'], captureTimeout: 60000, singleRun: false}) ;}; copy the code and it is best to copy karma. conf. js moves to/usr/local/lib/node_modules/karma/, so that karam is directly located in the root directory at startup. conf. js file. enter karma start amosli @ amosli-pc :~ $ Karma startINFO [karma]: Karma v0.12.14 server started at http: // localhost: 9876/INFO [Chrome 34.0.1847 (Linux)]: Connected on socket uj16fx9x5ckfclnw8n with id manual-8888