I'm trying to use Visual Studio as my IDE for developing an ASP.NET MVC 5 SPA with Angular 2.
The problem raises when I try to build the project. It gives me many errors inside *.d.ts
files.
I created the project using angular-cli
the command : ng new project-name
and here is what the solution explorer looks like :
How do I get rid of these errors? I haven't had any problems with using angular 2 in Visual Studio Code
Update :
According to your answers I added the following in the tsconfig.json
file, but it seems it doesn't work
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016"
]
},
"exclude": [
"./node_modules",
"**/*.spec.ts"
]
}
Make sure you're using the latest Typescript tools for your version of Visual Studio. A colleague of mine had a similar problem, if you've already excluded the node_modules folder in your tsconfig this may be the issue.
For VS 2015: https://www.microsoft.com/en-us/download/details.aspx?id=48593
{
"compilerOptions": {
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"outFile": "../../built/local/tsc.js",
"sourceMap": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With