我已收录 puppeteer-core
作为我的 TypeScript 项目中的依赖项,并且正在使用 Visual Studio 2019。当我尝试构建项目时,出现以下错误(如 Element
下的红色波浪下划线所示):
error TS2304: Build:Cannot find name 'Element'
请问我该如何解决?
最佳答案
添加 dom
到我的 tsconfig.json
的 array of libraries通过在 DOM library 中编译来修复该问题:
{
"compilerOptions": {
"lib": [
"es2018",
"dom"
]
}
}
关于TypeScript - Puppeteer 库错误 : "Cannot find name ' Element'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57999416/