我收到以下错误:
node_modules/@types/graphql/subscription/subscribe.d.ts(36,13): error TS2304: Cannot find name 'AsyncIterator'.
node_modules/@types/graphql/subscription/subscribe.d.ts(47,12): error TS2304: Cannot find name 'AsyncIterator'.
node_modules/@types/graphql/subscription/subscribe.d.ts(75,12): error TS2304: Cannot find name 'AsyncIterable'.
3:01:18 PM - Compilation complete. Watching for file changes.
即使向tsconfig文件中添加 esnext :
{
"compilerOptions": {
"outDir": "./dist/",
"lib": [
"esnext",
"esnext.asynciterable"
]
},
"include": [
"./src/**/*"
]
}
有什么办法解决这个问题吗?
答案 0 :(得分:0)
我遇到了同样的错误。我已将项目依赖关系更新为最新版本:
npm install -g npm-check-updates
ncu -u
以前的版本是这些
body-parser ^1.18.1 → ^1.19.0
express ^4.15.4 → ^4.17.1
reflect-metadata ^0.1.10 → ^0.1.13
@types/node ^8.10.61 → ^14.0.23
ts-node 3.3.0 → 8.10.2
typescript 3.3.3333 → 3.9.6