how to end ng serve or firebase serve

AngularFirebaseAngular CliFirebase Tools

Angular Problem Overview


I've been doing web development with Angular2 and have been using both Angular2 and Firebase to run local servers. I haven't been able to find a command similar to typing quit when using Ionic to create a server, so I have to close the terminal tab each time. Is there a way to end the server and get my terminal tab back?

Thanks.

Angular Solutions


Solution 1 - Angular

You can use the following command to end an ongoing process:

ctrl + c

Solution 2 - Angular

Try using ctrl + c twice to get the prompt for terminating the batch job.

Solution 3 - Angular

If you cannot see the "ng serve" command running, then you can do the following on Mac OSX (This should work on any Linux and Uni software as well).

ps -ef | grep "ng serve"

From this, find out the PID of the process and then kill it with the following command.

kill -9 <PID>

Solution 4 - Angular

I was able to stop via this on Windows for Angular 8:

Step 1: Find 4200 process

netstat -ano | findstr :4200

Step 2: Kill that process:

taskkill /PID <PID> /F

enter image description here

Solution 5 - Angular

If ctrl + c doesn't work use this:

ctrl +shift+ c

Sometimes people change the behaviour of ctrl + c for copy/pasting so you may need this.

Of course, you should also ensure that the terminal window has keyboard focus, ctrl + c won't work if your browser window has focus.

Solution 6 - Angular

ctrl + c OR ctrl + Pause/Break

Both will ask for Terminate batch job, then press Y or y and click enter.

Solution 7 - Angular

Can use

killall -9 

The killall command can be used to send a signal to a particular process by using its name. It means if you have five versions of the same program running, the killall command will kill all five.

Or you can use

pgrep "ng serve"

which will find the process id of ng and then you can use following command.

kill -9 <process_id>

Solution 8 - Angular

it is enough to modify something in your text editor and reload localhost. all your connection will be lost nd you have opsibility to ng serve the new project in the console.

Solution 9 - Angular

With Windows 10 / Powershell ctrl + c did not work; Powershell tried to gracefully stop the app.

Used normal cmd and had no issues stopping the ng serve with ctrl + c.

Solution 10 - Angular

I was trying to run this from within the Visual Studio 2017 Package Manager Console. None of the above suggestions worked.

See this link where Microsoft states "The solution is not to use package manager for angular development, but instead use powershell command line. ".

Solution 11 - Angular

for stop angular project press Ctrl+C twice , then press Y , then press Enter

Solution 12 - Angular

----Ctrl + c then choose Y from the Y/N option provided.

Solution 13 - Angular

On macOS Mojave 10.14.4, you can also try Command ⌘ + Q in a terminal.

Solution 14 - Angular

Exit the IDE and boots up IDE again , try it.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaheiginsView Question on Stackoverflow
Solution 1 - Angularstijn.aertsView Answer on Stackoverflow
Solution 2 - AngularPaulo CunhaView Answer on Stackoverflow
Solution 3 - AngularParthaView Answer on Stackoverflow
Solution 4 - AngularRaghavView Answer on Stackoverflow
Solution 5 - AngularBen TaliadorosView Answer on Stackoverflow
Solution 6 - AngularVishwa GView Answer on Stackoverflow
Solution 7 - AngularPooja KhatriView Answer on Stackoverflow
Solution 8 - AngularIstvan DembrovszkyView Answer on Stackoverflow
Solution 9 - AngularWitold KaczurbaView Answer on Stackoverflow
Solution 10 - AngularAndy ThomasView Answer on Stackoverflow
Solution 11 - AngularM KomaeiView Answer on Stackoverflow
Solution 12 - AngularHedegoView Answer on Stackoverflow
Solution 13 - Angularyehoni amranView Answer on Stackoverflow
Solution 14 - AngularHuy TrươngView Answer on Stackoverflow