SyntaxError: Unexpected token. async/await node 8

Viewed 1186

trying to use async/await with express. But getting error

const getData = async () => {
                      ^
SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)

Node version - 8.5.0

Part of code

const getData = async () => {
  return 'all done';
}

Any ideas? Thanks

1 Answers

The solution to this problem appears to be a re-installation of Node.

Related