Skip to content

September 14, 2016

Angular 2 CLI – Port Hog

by adamstephensen

I’m running lots of Angular 2 using the CLI on OSX (and loving it).

I have one small issue…

Often after stopping the app, when re-running it I get

Port 4200 is already in use.

Here is a little linux magic for you:

lsof -t -i tcp:4200 | xargs kill -9 | ng serve

This will find the process using port 4200, kill it, then re-serve your application.

(Posted for my FireBootCamp students that are having this issue.)

Advertisements
Read more from SPA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments