$ npm start
> [email protected] start /Users/Darius/Desktop/projects/ans/Voting-App
> node ./bin/www
/Users/Darius/Desktop/projects/ans/Voting-App/routes/index.js:34
}, callback(ret) {
^
SyntaxError: missing ) after argument list
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/Darius/Desktop/projects/ans/Voting-App/app.js:11:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Darius/.npm/_logs/2017-07-12T03_23_08_038Z-debug.log
But I checked several times, the syntax is perfectly ok.
/* POST login details. */
router.post('/sendtoken',
passwordless.requestToken(
// Turn the email address into an user ID
function(user, delivery, callback, req) {
// usually you would want something like:
User.find({
email: user
}, callback(ret) { //SyntaxError coming from this line
if (ret)
callback(null, ret.id)
else
callback(null, null)
})
// but you could also do the following
// if you want to allow anyone:
// callback(null, user);
}),
function(req, res) {
// success!
res.render('sent');
});