Angularjs learning --- Summary of common problems in karma installation and configuration in ubuntu12.04

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.