[英]typescript error TS2304: Cannot find name AsyncIterator even with esnext
我收到以下錯誤:
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.
即使將esnext添加到 tsconfig 文件:
{
"compilerOptions": {
"outDir": "./dist/",
"lib": [
"esnext",
"esnext.asynciterable"
]
},
"include": [
"./src/**/*"
]
}
有什么想法可以解決這個問題嗎?
我遇到了同樣的錯誤。 我已將更新項目依賴項修復到最新版本:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.