I study on this screencast myself as in a screencast I do

require('routes')(app); 

like this I do in routes / index.js

 module.esports = function (app) {...} 

I'm getting an error

 require('routes')(app); ^ TypeError: require(...) is not a function at Object.<anonymous> (/var/www/html/chatnode/app.js:24:18) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3 

what's wrong again?

Closed due to the fact that off-topic participants D-side , pavel , user207618, Grundy , Streletz Aug 29 '16 at 22:00 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - D-side, pavel, Community Spirit, Grundy, Streletz
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • A typo? module.esports -> module.exports - Maxim Timakov

1 answer 1

Change to

 const app = require('routes'); 

and correct the module.esports typo on module.exports