学习使用 express server,于是建立 了一个新项目 package.json
{
"name": "@my/server",
"version": "1.0.0",
"scripts": {
"server": "node src/express-server.js"
},
"dependencies": {
"express": "^4.17.1",
"lodash": "^4.17.15"
}
}
然后新建立了一个 baseDB.js (是一个 js 文件,不是 ts 文件)
class baseDB {
constructor() {
this.items = [];
}
load() {
// will be implemented in the sub-class
console.log("will be implemented in the sub-class");
}
aync save() {
console.log("will be implemented in the sub-class");
}
}
然后有关键字aync的那一行,就提示有错误。';' expected.ts(1005)
大家有没有碰到类似的问题?谢谢!

p.s. https://github.com/microsoft/vscode/issues/54261
VSCode github 上面曾经有类似的问题,2018 年报的,可惜,那个帖子不了了之了......