node.js - Error while running js file via node -
i trying run koa app.js file not work.
here's app.js
var koa = require('koa'), monk = require('monk'), wrap = require('co-monk'); var db = monk("mongodb url here"), collection = db.get('mycollection'), transactions = wrap(collection); var app = koa(); app.use(function*(){ var res = yield transactions.find({}); console.log(res); }); app.listen(3000);
and here's error got:
typeerror: cannot read property 'name' of undefined @ makeskinclass (/home/ric/node_modules/mongoskin/lib/utils.js:33:43) @ object.<anonymous> (/home/ric/node_modules/mongoskin/lib/grid.js:6:35) @ module._compile (module.js:398:26) @ object.module._extensions..js (module.js:405:10) @ module.load (module.js:344:32) @ function.module._load (module.js:301:12) @ module.require (module.js:354:17) @ require (internal/module.js:12:17) @ object.<anonymous> (/home/ric/node_modules/mongoskin/lib/db.js:22:16) @ module._compile (module.js:398:26) @ object.module._extensions..js (module.js:405:10) @ module.load (module.js:344:32) @ function.module._load (module.js:301:12) @ module.require (module.js:354:17) @ require (internal/module.js:12:17) @ object.<anonymous> (/home/ric/node_modules/mongoskin/lib/mongo_client.js:5:14)
i'm still new koa,nodejs i'm having hard time figuring out. great!
Comments
Post a Comment