pid-terminator
Every so often, I get the following error: Error: listen EADDRINUSE 127.0.0.1:3000
.
This module allows to terminate a process(pid) associated with a localhost/port that
is still running in the background even though the application was closed.For now, Mac only.
installation
global
npm install pid-terminator -g
local
npm install pid-terminator --save-dev
usage
you can terminate one or more processes:
$ pid-terminator PORT_Nº [PORT_Nº[...]]
you can also call it from a npm script
in you package.json
. Before
running the node application, pid-terminator
will verify if a process
associated with localhost:4000
is already running and terminate it if it does.