Nik Terentyev
Nik Terentyev

Reputation: 2310

node 0.11.13 gives an error for generator syntax

Node version 0.11.13 gives out an error:

enter image description here

How it can be solved?

PS the code is a simple example:

var koa = require('koa');
var app = koa();

app.use(function *(){
  this.body = 'Hello World';
});

app.listen(3000);

Upvotes: 0

Views: 76

Answers (1)

Interrobang
Interrobang

Reputation: 17434

You'll have to run Node with the --harmony flag at the command line to enable features like generators that are part of Harmony.

Upvotes: 1

Related Questions