Tuesday, January 28, 2020

Cannot GET /

I get this error when I try to swap out the package.json and package-lock.json in an Angular 8 application that is the front end for a Visual Studio 2019 .NET Core MVC application with the sister files made by an Angular 8 application made via the Angular CLI. I get this after I run npm install to rehydrate node_modules as if I don't do that second bit I get a different error reading:

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "C:\\Experiment\\VSExperiment\\experiment\\experiment\\ClientApp".

 
 

Why would I want to experiment with this anyways? Well, the problem with the way Visual Studio makes an Angular 8 application is that you cannot run the tests. Therefore, we need a workaround for that. Why not try to shove what is healthy in place of what is sick? It unfortunately leads to more sickness however it would seem, a worse sickness, an app that won't run at all. My superior may have found another way. In attempting to introduce Angular 8 to an MVC app that just had Razor stuff in it, he ran these two shell commands:

  • ng new ClientApp --createApplication=false
  • ng generate application app1

 
 

He may have navigated into the ClientApp folder between the two commands. Also, I think when he successfully ran the application he created, he just did it through the shell too at localhost:4200 meaning that the Angular gunk is not truly integrated with our other code yet. We still have a ways to go on this. I'll keep you updated. HtmlAgilityPack is in the mix too. It helps parse DOM elements.

No comments:

Post a Comment