I am surprised that I did not find any more questions about this on the Internet. In any case, I should work without the --harmony flag.
They are currently working on V2.* , Which has ES6 support. You can find it on your git repository in the V2 branch section https://github.com/koajs/koa .
So you need npm install koa@next -save to grab the last one that is currently "koa": "^2.0.0-alpha.3" .
To make sure that it works, you can quickly throw it into the index.js file, then run node index.js :
const Koa = require('koa'); const app = new Koa(); // logger app.use((ctx, next) => { const start = new Date; return next().then(() => { const ms = new Date - start; console.log(`${ctx.method} ${ctx.url} - ${ms}ms`); }); }); // response app.use(ctx => { ctx.body = 'Hello World'; }); app.listen(3000);
V2, when stable will be merged into a master branch, and only npm install koa will work. But for what I wanted, npm install koa@next -save worked fine :)
source share