Visual studio 由于 Typescript SDK 较旧,2017 年任务在 Azure 管道中失败

Visual studio 2017 task failing in azure pipeline due to older Typescript SDK

Visual studio 2017 构建在构建时抛出错误

src\Service\node_modules\utility-types\dist\aliases-and-guards.d.ts(10,51): Error TS2304: Build:Cannot find name 'bigint

这仅在管道上观察到,在本地它工作正常。

我做了家庭作业并将我的打字稿从 3.1 升级到 3.7,但是 VS 任务仍然无法理解并在构建时抛出错误。

这是 Azure 管道中的 运行,因此任务和整个管道都失败了。

tsconfig

{ "compilerOptions": { "moduleResolution": "node", // csstype included by React "target": "es2016", // <Counter /> "jsx": "react", "sourceMap": true, "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "types": ["chrome", "react", "jest", "node"], "outDir": "./ClientApp/Scripts/js/" }, "exclude": ["/node_modules"] }

这可以通过包含在您的 .csproj 文件中来解决 <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>