TypeError: object is not a function Node js Node Authentication
authentication, express, javascript, node.js
Solution
Make sure your `./app/routes.js` module returns a function. It should be something like:
module.exports = function(app, passport) {
//...
};
Problem
This is one of my first stack overflow questions, so I'll try to do my best in asking my question.. I'm following this tutorial exactly ( http://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local ) and after the third part ( "Application Setup server.js) when I try to run the server I get "TypeError: object is not a function" for the line: ``` require('./app/routes.js')(app, pspt); // load our routes and pass in our app ``` I found other people having similar problems that were caused by naming conflicts with local variables. I tried renaming passport to pspt but it seems like the error was found at the start of the second parenthesis, before my variables. Should I rename the 'app/routes' folder? Thanks! EDIT: Yeah, the tutorial made it seem like it should work right after the third part. I moved onto the fourth part and it worked fine. Thanks again.