NodeJS script with async/await causing syntax error (v7.10.0)
I am trying to use async/await in NodeJS but my script is throwing a syntax error. I was under the impression that async/await is supported naively since Node 7.6 . When I run node -v I get v7.10.0 . Here is the contents of index.js : async function getValueAsync() { return new Promise(function(resolve) { resolve('foo'); }); } let value = await getValueAsync(); console.log(value); But when I invoke this script with node index.js I get: let value = await getValueAsync(); ^^^^^^^^^^^^^ SyntaxError: Unexpected identifier at createScript (vm.js:53:10) at Object.runInThisContext (vm.js:95:10) at