I'm receiving an 'Unexpected token' error in typescript where I'm trying to write an async function like this:
async function test() {
...
}
I've seen that this can be caused due to running an older version of node that doesn't support async function syntax, but mine was running version 8.
Just to remove any possibility of my node version not supporting this, I've just updated to version 9.11.1, checked that this is being used in the command line, and the async prefix is still returning the unexpected token error.
async test(){}?async function test() { }syntax should be perfectly valid, though