我有一个现有的C#项目,一直在添加角度视图(TypeScript文件)。我最近将另一个项目中的node_modules文件夹复制到了我的C#项目中(因此,我不必重新安装一堆模块)。此后不久,我开始出现如下错误:
Severity Code Description Project File Line Suppression State
Error TS2304 (TS) Cannot find name 'Set'. InventivWebsite1 C:\Users\king\Desktop\_REPOS\inventiv-website-1\InventivWebsite1\app\node_modules\@angular\common\src\directives\ng_class.d.ts 48 Active
Error TS2304 (TS) Cannot find name 'Map'. InventivWebsite1 C:\Users\king\Desktop\_REPOS\inventiv-website-1\InventivWebsite1\app\node_modules\@angular\common\src\pipes\keyvalue_pipe.d.ts 42 Active
Error TS2304 (TS) Cannot find name 'Map'. InventivWebsite1 C:\Users\king\Desktop\_REPOS\inventiv-website-1\InventivWebsite1\app\node_modules\@angular\common\src\pipes\keyvalue_pipe.d.ts 45 Active
Error TS2304 (TS) Cannot find name 'Map'. InventivWebsite1 C:\Users\king\Desktop\_REPOS\inventiv-website-1\InventivWebsite1\app\node_modules\@angular\common\src\pipes\keyvalue_pipe.d.ts 46 Active
Error TS2304 (TS) Cannot find name 'Iterable'. InventivWebsite1 C:\Users\king\Desktop\_REPOS\inventiv-website-1\InventivWebsite1\app\node_modules\@angular\core\src\change_detection\differs\default_iterable_differ.d.ts 19 Active
基于某种谷歌搜索,似乎大多数使用Node的人都通过在其应用文件夹中添加tsconfig.json文件来解决此问题,但是当我尝试这样做没有帮助时(可能是因为我不使用node,但是具有ac#后端),但以防万一我添加的文件在下面。欢迎任何建议。
tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": false,
"module": "es2015",
"moduleResolution": "node",
"paths": {},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
},
"files": [],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}