npm start fails ( Error: listen EADDRINUSE :::3000 )

I deployed my MEAN project on ubuntu. Very often I got the message showing that the port 3000 was in use.

I use the following command to find the pid occupying the port 3000.

sudo netstat -peanut | grep 3000 | awk ‘{ print $9 }’ | sed ‘s:/[^/]*$::’ | grep -Eo ‘[0-9]{1,5}’

In my case, the pid returned is 4532

Then I terminate the process using the command kill.

kill 4532

Finally, npm start succeeds.

Advertisements

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