The NPM script ‘start’ exited without indicating that the Angular CLI was listening for requests
When I tried to run my Application, I got this exception
“The NPM script ‘start’ exited without indicating that the Angular CLI was listening for requests”
Background:
I was working on a project using Angular 5 SPA(Single Page Application) Template in Asp.Net Core 2.1. I created .net core application having Angular Cli support which is a really nice way to work with Angular.
Full Exception was something like this:
An unhandled exception occurred while processing the request.
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: Unknown option: ‘–extractCss‘
InvalidOperationException: The NPM script ‘start’ exited without indicating that the Angular CLI was listening for requests. The error output was: Unknown option: ‘–extractCss‘
I thought that like most of the times angular application throw exceptions due to missing upgrades so I tried all the steps below but the problem was still there:
npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli
ng update @angular/core
sa
after wasting hours I finally managed to solve my problem.
Solution:
I edited my package.json file and remove the –extractCss parameter from the start and build property.
Click the Button Below to View Solution Code Example.
“scripts”: { “ng”: “ng”, “start”: “ng serve –extract-css”, “build”: “ng build –extract-css”,
to:
“scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”,
Comment if you find this solution helpful or still facing the problem.
This worked for me. Why does it work?
Thanks, it’s work.
Thanks, You saved my hours