angular-seed project throws createServer(){} has no method 'json()'

时间:2015-11-12 12:02:52

标签: angularjs node.js angular-seed

I am finding this issue with the angular-seed project. This issue happens when I run `npm test'. This happens just after downloading the seed, without modifying any of its files. Here is the error I am getting:

var json = require('connect').json()
                              ^
TypeError: Object function createServer() {
  function app(req, res, next){ app.handle(req, res, next); }
  merge(app, proto);
  merge(app, EventEmitter.prototype);
  app.route = '/';
  app.stack = [];
  return app;
} has no method 'json'
    at Object.<anonymous> (C:\Learning\Web\AngularJs\Projects\angular-seed\node_modules\karma\lib\middleware\runner.js:11:31)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Learning\Web\AngularJs\Projects\angular-seed\node_modules\karma\lib\web-server.js:7:24)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
npm ERR! weird error 8
npm ERR! not ok code 0

I have seen some posts in StackOverflow like this one. I have reinstalled karma, karma-jasmine and karma-phantomjs-launcher. But did not help.

Any solution for this issue?

1 个答案:

答案 0 :(得分:0)

升级node.js解决了这个问题。我是node.js版本~0.10。