Search code examples
node.jskoa

Getting koa to work (nodejs web framework)


I am running Deepin and trying to get koa to work. There is little documentation on the subject.

I did the following as stated on koajs.com:

$ npm install -g n
$ n 0.11
$ node --harmony my-koa-app.js

I recieve the error:

➜test-koa-app$ sudo node --harmony test-koa-app.js
module.js:338
    throw err;
          ^
Error: Cannot find module 'koa'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/karl/nodejs/test-koa-app/test-koa-app.js:1:73)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)

Solution

  • Version 2 of koa now out. Go here:

    https://github.com/koajs/koa