error TS1086: An accessor cannot be declared in an ambient context

266 阅读1分钟

error TS1086 错误解决

安装npm包后,运行项目报错。

报错信息如下

ERROR in node_modules/xxx/xxx/xxxx.d.ts(15,9): error TS1086: An accessor cannot be declared in an ambient context.

解决方法

修改 tsconfig.json 文件

{
  "compilerOptions": {
    "skipLibCheck": true
  }
}