bradtraversy / node_passport_login

Node.js login, registration and access control using Express and Passport
1.74k stars 1.29k forks source link

Could not launch project #37

Open aniketmule opened 5 years ago

aniketmule commented 5 years ago

Upon running I get the following error. Had to change filename /models/user.js to /models/User.js

aniket@aniket:~/node_passport_login$ npm start

 node_passport_login@2.0.0 start /home/aniket/node_passport_login
 node app.js

module.js:550
    throw err;
    ^

Error: Cannot find module '../models/User'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/aniket/node_passport_login/config/passport.js:6:14)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/aniket/node_passport_login/app.js:11:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node_passport_login@2.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node_passport_login@2.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
skngetich commented 5 years ago

The file has to be there /models/User.js. or you ca rename the file

ehsankorhani commented 5 years ago

File name is case sensitive . in your "config/passport.js" file.(user instead of User) Change line 6 to: const User = require('../models/user');

Do the same thing in line 6 of: "routes/users.js"