繁体   English   中英

由于react / types / index.d.ts而导致VS2017构建失败

[英]VS2017 Build failing because of react/types/index.d.ts

我已经在VS2017中设置了Typescript + React项目。 我正在使用webpack来编译tsx,这编译得很好。

但是现在当我构建项目时,由于node_modules\\@types\\react\\index.d.ts出现一些随机的语法错误,该项目失败了(我已经安装了所有最新版本的Typescript,react)。

错误生成:“>”预期。

要解决这个问题,我有什么选择?如何正确构建它,或者只是忽略此错误并继续?

tsconfig.json看起来像这样:

{
  "compilerOptions": {
    "outDir": "./dist",
    "sourceMap": true,
    "noImplicitAny": false,
    "module": "commonjs",
    "target": "es5",
    "jsx": "react",
    "moduleResolution": "node",
    "skipLibCheck": true,
    "skipDefaultLibCheck": true
  },
  "compileOnSave": false,
  "include": [
    "./PageModels/src/**/*"
  ],
  "exclude": [
    "node_modules",
    "wwwroot"
  ]
}

为我更新了最新版本的Visual Studio,此版本使用的TypeScript与我通过npm安装的版本不同。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM