npm - WebStorm: Karma server not starting, TypeError: undefined is not a function on server.start(); -


i have latest version of webstorm (10.0.4). today wanted include karma in project installed python , ran:

npm install -g karma npm install karma npm install karma-jasmine npm install karma-chrome-launcher npm install karma-phantomjs-launcher 

i tried 2 different config files, 1 project , 1 superbasic config, both throw same error. here basic config:

// karma configuration // generated on fri jul 17 2015 14:05:46 gmt+0200 (mitteleuropäische sommerzeit)  module.exports = function(config) {   config.set({      // base path used resolve patterns (eg. files, exclude)     basepath: '',       // frameworks use     // available frameworks: https://npmjs.org/browse/keyword/karma-adapter     frameworks: ['jasmine'],       // list of files / patterns load in browser     files: [       'test/**/*spec.js'     ],       // list of files exclude     exclude: [     ],       // preprocess matching files before serving them browser     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor     preprocessors: {     },       // test results reporter use     // possible values: 'dots', 'progress'     // available reporters: https://npmjs.org/browse/keyword/karma-reporter     reporters: ['progress'],       // web server port     port: 9876,       // enable / disable colors in output (reporters , logs)     colors: true,       // level of logging     // possible values: config.log_disable || config.log_error || config.log_warn || config.log_info || config.log_debug     loglevel: config.log_info,       // enable / disable watching file , executing tests whenever file changes     autowatch: true,       // start these browsers     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher     browsers: ['chrome'],       // continuous integration mode     // if true, karma captures browsers, runs tests , exits     singlerun: false   }) } 

i created new "karma" run configuration, when click run, says:

"c:\program files\nodejs\node.exe" "c:\program files (x86)\jetbrains\webstorm 10.0.4\plugins\js-karma\js_reporter\karma-intellij\lib\intellijserver.js" --karmapackagedir=c:\workspace\full_ui\node_modules\karma --configfile=c:\workspace\full_ui\tests\karma.conf_messages.js --browsers=chrome c:\program files (x86)\jetbrains\webstorm 10.0.4\plugins\js-karma\js_reporter\karma-intellij\lib\intellijserver.js:10 server.start(clioptions);        ^ typeerror: undefined not function     @ object.<anonymous> (c:\program files (x86)\jetbrains\webstorm 10.0.4\plugins\js-karma\js_reporter\karma-intellij\lib\intellijserver.js:10:8)     @ module._compile (module.js:460:26)     @ object.module._extensions..js (module.js:478:10)     @ module.load (module.js:355:32)     @ function.module._load (module.js:310:12)     @ function.module.runmain (module.js:501:10)     @ startup (node.js:129:16)     @ node.js:814:3  process finished exit code 1 

i don't know cause problem. did miss install? have never used karma before, might have basic error somewhere, can't figure out what.

i think may caused recent update karma lib 9 days ago

https://github.com/karma-runner/karma/commits/master/lib/server.js

it intellijserver.js out of date , needs altered. i've got working updating intellijserver.js (until intellij fix it) with:

  var cli = require('./intellijcli.js')   , server = cli.requirekarmamodule('lib/server.js')   , clioptions = { configfile: require.resolve('./intellij.conf.js') };  var browsers = cli.getbrowsers(); if (browsers != null) {   clioptions.browsers = browsers; }  var server=new server(clioptions); server.start();  // prevent karma server being orphan process. // example, if webstorm killed using sigkill, karma server still alive. // when webstorm terminated, karma server's standard input closed automatically. process.stdin.resume(); process.stdin.on('close', function () {   // terminating orphan process   process.exit(123); }); 

once got server bit working got issue no provider “framework:jasmine”! (however appears separate unrelated issue affecting me, because didn't setup karma). resolved with:

npm install karma-jasmine --save-dev npm install karma-chrome-launcher --save-dev 

followed

npm install 

Comments