Javascript: SyntaxError: await is only valid in async function
问题 I am on Node 8 with Sequelize.js Gtting the following error when trying to use await . SyntaxError: await is only valid in async function Code: async function addEvent(req, callback) { var db = req.app.get('db'); var event = req.body.event db.App.findOne({ where: { owner_id: req.user_id, } }).then((app) => { let promise = new Promise((resolve, reject) => { setTimeout(() => resolve("done!"), 6000) }) // I get an error at this point let result = await promise; // let result = await promise; //