S
S
Sergey Beloventsev2016-08-28 22:26:43
Node.js
Sergey Beloventsev, 2016-08-28 22:26:43

Another error in node, how to fix it?

I 'm learning from this screencast , as in the screencast, I do
require('routes')(app);
it like this, I do it in routes/index.js
module.esports = function (app) {...}
, I connect, I get 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?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bowen, 2016-08-28
@Sergalas

require('./routes')(app);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question