SyntaxError:意外的令牌功能-异步等待Node.js
我正在尝试将Node 6.2.1版与一些代码一起使用。计划将大多数面向超级回调的代码迁移到看起来更干净甚至性能更好的代码上。 我不知道为什么,当我尝试执行节点代码时,终端抛出一个错误。 helloz.js (async function testingAsyncAwait() { await console.log("Print me!"); })(); 日志- BOZZMOB-M-T0HZ:rest bozzmob$ node helloz.js /Users/bozzmob/Documents/work/nextgennms/rest/helloz.js:1 (function (exports, require, module, __filename, __dirname) { (async function testingAsyncAwait() { ^^^^^^^^ SyntaxError: Unexpected token function at Object.exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:513:28) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at …