SyntaxError:意外的令牌。 async / await node 8

时间:2017-09-25 12:47:37

标签: javascript node.js

尝试使用async/await和express。但是得到错误

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)

节点版本 - 8.5.0

部分代码

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

有什么想法吗? 感谢

1 个答案:

答案 0 :(得分:-2)

解决此问题的方法似乎是重新安装Node。

相关问题