在“xxx”上没有“xxx”属性。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 xxx 或更高版本?

image.png

tsconfig.json文件如下,不管lib是换成esnext还是es2017 es2017.String 都不能消除这个错误,请大佬指点一下该怎么解决?

{
  "include":  ["xxxx"],
  "compilerOptions": {
    "target": "esnext",                          
    "module": "esnext",                     
    "lib": [                                  
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ],
    "allowJs": true,                       
    "declaration": true,                   
    "sourceMap": true,                     
    "outDir": "lib",                        
    "rootDir": "source",                       
    "strict": true,                           
    "types": [],                           
    "allowSyntheticDefaultImports": true,  
    "esModuleInterop": true,                  
    "skipLibCheck": true,                     
    "forceConsistentCasingInFileNames": true  
  }
}
阅读 3.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题