Reactjs VS2017生成失败,因为react/types/index.d.ts
我在VS2017中建立了一个Typescript+React项目。我正在使用webpack来编译tsx,这很好 但是现在当我构建项目时,由于Reactjs VS2017生成失败,因为react/types/index.d.ts,reactjs,typescript,visual-studio-2017,Reactjs,Typescript,Visual Studio 2017,我在VS2017中建立了一个Typescript+React项目。我正在使用webpack来编译tsx,这很好 但是现在当我构建项目时,由于node\u modules\@types\react\index.d.ts中的一些随机sytax错误,它失败了(我已经安装了所有最新版本的typescript,react) 生成错误:应为“>” 我可以选择哪些方法来解决这个问题,如何正确构建它,或者忽略这个错误并继续 tsconfig.json如下所示: { "compilerOptions": {
node\u modules\@types\react\index.d.ts
中的一些随机sytax错误,它失败了(我已经安装了所有最新版本的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安装的版本不同。更新到Visual Studio的最新版本为我解决了这一问题,该构建使用的TypeScript版本与我通过npm安装的版本不同