[1.7.0] ng serve not properly killed on CTRL+C with yarn/npm #9647
Description
Activity
Note that the problem happens both on windows and linux
I'm seeing this too. Having to resort to running
sudo lsof -t -i tcp:4200 | xargs kill -9before serving againAlso appears on OS X. two Control-C to kill the server.
Oh my god this is the worst - same issue here. Anyone find a fix? So aggravating. Running CLI v1.6.8, Ubuntu 16.04LTS vagrant VM.
I see this too, but it only happens when I use yarn to run my npm scripts. (OS X btw)
Try
ctrl + shift + cReacted by Thanesh Rajandran, erhise, codeepic, Leonardo Soares e Silva and acolleReacted by codeepic and Saiyaff FaroukReacted by codeepicReacted by erhise and codeepicYeah I saw that on a SO answer and tried several variations, including
ctrl + Z, etc. This was never an issue prior to updating from Angular CLI 1.5 to 1.6.8. Regular 'olctrl + cwould stop everything. Now it just drops back to a command prompt and leaves 2 processes running. One forngand one for ansh ng ...that runs the actual webserver. It's just aggravating. I ended up adding another command to mypackage.jsoncalledkilland set it tosudo lsof -t -i tcp:443 | xargs kill -s 9(my app runs on SSL, sub 443 for whatever port you're using). Still would be great to find a way to make this work like it used to.Reacted by Nariman Mandi and Eli- added a commit that references this issue
on Feb 17, 2018 +1
Very annoying!
Thanks God I noticed this before upgrading my main project.- added a commit that references this issue
on Feb 19, 2018 To temporary workaround this issue you can remove line 382 from
node_modules/@ngtools/webpack/src/angular_compiler_plugin.js. This line should haveprocess.once('SIGINT', handleParentProcessExit);.Reacted by DelphiWorlds- added 3 commits that reference this issue
on Feb 19, 2018 4 remaining items
killall ngReacted by Nariman Mandi, ClementVidal, Brayan Jesús Salcedo, Tomohiro (Tomo) SHIOYA, Kevin Jones-Evans, coffeetea-synchestra, Daniel Ramírez and Morris FrankenReacted by Saiyaff FaroukReacted by Martin Simoneau, Metod Ribič, Brayan Jesús Salcedo, Kevin Jones-Evans and coffeetea-synchestraReacted by Nicolas Leblanc, Martin Simoneau, Brayan Jesús Salcedo and coffeetea-synchestra- added a commit that references this issue
on Feb 21, 2018 - added a commit that references this issue
on Feb 21, 2018 fwiw ... #9668 refers to this issue using
ng serve --aot. I'm seeing this happen with just a regularng serveand wanted to make sure that was accounted for in the other thread. Thanks!@switch120 It should fix it without
--aotas well.Reacted by Scott Byers- added a commit that references this issue
on Feb 22, 2018 - added a commit that references this issue
on Apr 23, 2018 angular-automatic-lock-bot commented
on Sep 7, 2019 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Sep 7, 2019 - added a commit that references this issue
on May 29, 2026
Versions
Repro steps
Observed behavior
the ng process is still running
Desired behavior
The ng process should be stopped.
It is stopped with v1.6.8 but not with v1.7.0
Mention any other details that might be useful (optional)
It happens also with node 8, with yarn or npm. The version of those did not change: only switching between v1.6.8 and v1.7.0 exhibits the problem.
When running
ng serveby hand, surprisingly hitting ctrl+c does not stop the ng process, but you have to hit ctrl+c again for it to happen!