how to end ng serve or firebase serve
Solution 1
You can use the following command to end an ongoing process:
ctrl + c
Solution 2
Try using ctrl + c twice to get the prompt for terminating the batch job.
Solution 3
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
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
Solution 5
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.
aheigins
Am Currently: a HCI masters student at UCL Would do for Free: Political startups, web technologies, hybrid app development, GOOD UX design/products My personal idea of Hell: Learning about windows or incompatible driver issues.
Updated on June 01, 2021Comments
-
aheigins almost 3 years
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.
-
Shawn de Wet about 7 yearsI have ng serve running in a console window, and it just is not responding to ctrl+c at all.
-
Muhammad Nadeem about 6 yearsCtrl+c twice needed
-
André Kool over 5 years@Jonathan Please make sure you fix as much as possible when you suggest an edit. In this case make sure the sentence starts with a capital letter and ends with a point for example.
-
Yacino over 5 yearsThanks you that helped me. If you are on Windows, just open the task manager and kill the node.exe process. Hope this will help
-
kirodge almost 5 yearstaskkill /F /IM node.exe (Careful: this force closes all instances of node.exe on Windows)
-
Sylhare over 4 yearsWelcome to StackOverFlow you can check the link How To Answer so your answers will help more people
-
Caltor about 4 yearsSeems unnecessarily hard when you can use Ctrl+C ?
-
Caltor about 4 yearsOnly relevant if you are running ng serve inside the IDE terminal
-
Caltor about 4 yearsThis answer duplicates existing answers and adds nothing new. In fact is also lacks better formatting present in other previous answers.
-
Patrick almost 4 yearsActually the first time shows the prompt
Terminate batch job (Y/N)?
and it looks like the second time forces the termination. -
Vishal Sharma almost 4 years@Caltor when you close that terminal but the server is running it is very much helpful in that scenario
-
Alreadytakenindeed over 3 years@Caltor in my case Ctrl+C in the console was just giving me ^C which is totally useless.
-
Adir D over 3 yearsIn case of using IntelliJ, pay attention to open the first console u used, ng is still running there, you might have multiple console tabs opened
-
webpreneur over 3 yearsDid the job for me on Windows 10. Thanks.
-
user1931751 about 3 years@ShawndeWet: same here, on Windows 10 with angular 10.x.x; however, it seems to take a minute or 2 to respond. Pressed CTRL+C and 2 minutes later I had the "abort batch process (y/N)" prompt. Edit: pressing ctrl+c multiple times doesn't seem to reduce this time.
-
pixel almost 3 yearsthat kills terminal, not ng serve command
-
gdubs almost 3 yearsthanks for this. this is what i needed since my app was still running even after shutting down webstorm
-
phancuongviet over 2 yearsIt worked for me! thanks