The NPM script 'start' exited without indicating that the Angular CLI was listening for requests

前端 未结 8 1914
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 06:36

I\'m attempting to start an .NET Core 2/Angular 6 SPA. I created an Angular 5 Application using "dotnet new angular" then proceeded to upgrade using this guide fro

8条回答
  •  自闭症患者
    2020-12-03 06:50

    I was trying to get a GitHub project working from scratch. These are the things I did to do that:

    • Download and install NodeJS: https://nodejs.org/en/download
    • Download any AngularJS project from GitHub
    • Run a command prompt and navigate to the "client-app" folder: dotnet new angular -o "C:\Users\me\OneDrive\Documents\Visual Studio 2017\Projects\myproject\myproject-dev\myproject-client-app" --force
    • Enter command: npm install -g @angular/cli
    • Enter command: npm build fix
    • Enter command: npm run ng
    • Enter command: npm start
    • Enter command: ng start --extract-css

    (I didn't actually need to enter this last command, since npm start initiated this command for my project, but might not always be the case...)

    In 'Startup.cs' file, replace

    spa.UseAngularCliServer(..)
    

    with

    spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
    

    Then F5 to start the ASP .NET Core project as we normally do to start debugging the application.

    After all of that, the project should run.

提交回复
热议问题