0

I am trying to add angular5 to .net mvc web api . I have searched over and found some answers but that doesn't work for me . Following steps i followed :

  1. I cloned latest version from github of angular5 on my desktop.
  2. Then i created a new project in visual studio 2015 selecting mvc and webapi.
  3. Then i copied package.json to root directory of newly created project in vs 2015.
  4. I then by right clicking on package.json navigate to restore packages and it is supposed to add node_modules to root directory and it added that.
  5. Then i copied tsconfig.app , main.ts and app folder to root directory and by clicking on it included it in.

However after following all these steps i ran for build but i got error as "tsc : error TS5023: Build:Unknown compiler option 'lib'"

My tsc file is below ::

{
  "compilerOptions": 
{
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2015", "dom" ],
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true
  }
}

Any help will be highly appreciated as i am stucked in this for a long time .

UPDATED 02 FEB 2018 Hello now i have solved the issue .. it is running now but it is unable to load my angular component. On browser console i can see the following errors: screenshot of the error screen

deepak
  • 15
  • 6
  • "doesn't work" tells people nothing useful. Describe what actually goes wrong. Did you follow any kind of guidance? If so then link to it. – ADyson Jan 24 '18 at 13:43
  • @ADyson i have followed a video on youtube . following is the link . https://www.youtube.com/watch?v=rbHSTJBhJ44 – deepak Jan 24 '18 at 13:48
  • Ok. Well I'm not watching all that to see if you followed it correctly. Apart from anything, I've only got your description of what you did to go on, not visibility of what you _actually_ did. Like I said, you need to provide details of your problem as well, not just "doesn't work". – ADyson Jan 24 '18 at 13:52
  • @ADyson on creating build i got the following error ::C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(214,5): error MSB6006: "tsc.exe" – deepak Jan 24 '18 at 14:11
  • That just looks like a file path, not a full error message. Are you sure there are no other details following that? – ADyson Jan 24 '18 at 14:23
  • https://github.com/angular/quickstart This is link from where i have cloned angular code and added files package.json , src/app folder , src/systemjs.config.js , src/systemjs-angular-loader.js ,src/tsconfig.json and then i copied script from src/index.html and pasted it to views/shared/_Layout.cshtml. and copied body portion from src/index.html and pasted to views/home/index.html. Finally i copied src/main.ts and pasted it to app folder. i saved it click on rebuild but rebuild failed giving above mentioned error. – deepak Jan 24 '18 at 14:28
  • error MSB6006: "tsc.exe" exited with code 1. this is error and like this it showing a count of 2175 errors. I don't know what this is all . – deepak Jan 24 '18 at 14:30
  • I followed one solution over stackflow and someone assisted to download latest version of typescript from the link https://www.microsoft.com/en-us/download/confirmation.aspx?id=48593 . I downloaded this and installed . but rather solving the problem now a new error is occured that is --> tsc : error TS5023: Build:Unknown compiler option 'lib'. – deepak Jan 24 '18 at 14:47
  • I suggest you edit and clarify your question to that effect and include the relevant error details. Seems it's specific to how to integrate typescript into Visual Studio, rather than anything to do with angular or MVC per se. – ADyson Jan 24 '18 at 15:51
  • hey ADyson ... i have done a lot of search but still i am not able to get a proper solution . Look now the error i am getting is " tsc : error TS5023: Build:Unknown compiler option 'lib' " , my tsc file is as below ::-> { "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2015", "dom" ], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true } } – deepak Jan 25 '18 at 06:01
  • still waiting for an answer:: following errors i am getting :: shim.min.js Failed to load resource: the server responded with a status of 404 (Not Found) zone.js Failed to load resource: the server responded with a status of 404 (Not Found) system.src.js Failed to load resource: the server responded with a status of 404 (Not Found) systemjs.config.js Failed to load resource: the server responded with a status of 404 (Not Found) shim.min.js Failed to load resource: the server responded with a status of 404 (Not Found) – deepak Feb 02 '18 at 07:57

0 Answers0