【发布时间】:2019-10-15 17:56:15
【问题描述】:
我正在尝试在node.js v6.11 上添加async 方法,但我收到Unexpected identifier 错误。
let fs = require('fs');
let Config = require('../somefolders/config.js');
module.exports = class SomeClassName {
constructor(id = null) {
}
//Some other methods
static async test1234(param) {
}
//Some other Static methods
}
这是我们得到的错误:
【问题讨论】:
-
欢迎来到 Stack Overflow!请使用tour,环顾四周,并通读help center,尤其是How do I ask a good question? 邮政编码、标记和错误消息作为文本,而不是作为图片 的文本。为什么:meta.stackoverflow.com/q/285551/157247
-
我使用的是 v6.11。非常感谢@T.J.Crowder
-
是的,这已经严重过时了。 :-) 当前是 v12,当前 LTS 是 v10:nodejs.org/en/download
标签: javascript node.js asynchronous async-await