Coffeescript + Express: unexpected ,

2019-08-03 05:08发布

问题:

I'm learning to make an app on Express.js using Coffeescript. I have uploaded my code at: https://github.com/findjashua/contactlist

When I try to run the app, I get the following error:

app.coffee:11:24: error: unexpected ,
res.send 'Hello World'
                   ^

I don't understand the issue here. Any ideas?

回答1:

On line 11 in contacts.coffee you have

exports.index = (req, res) ->
  ContactModel.find (err, contacts), ->
    if not err

remove that comma on the central line, after contacts).