Ganache EADDRINUSE: address already in use
1 min readJan 21, 2019
While developing Ethereum dApps, it is common to run into an issue where a local blockchain such as geth or ganache (test-rpc) didn’t shut down gracefully.
This can cause the dreaded EADDRINUSE error:
Ganache CLI v6.2.5 (ganache-core: 2.3.3)
listen EADDRINUSE: address already in use 127.0.0.1:8545
To find the process using this port, lsof is a great tool. Type:
lsof -i :8545
This will give you a list of all of the programs using that port. An example output:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Ganache 45624 dbe 32u IPv4 0x2870b9f699b92777 0t0 TCP localhost:64105->localhost:8545 (ESTABLISHED)
Make sure this process isn’t crucial to some other project you are running, but then just use ‘kill’, specifying the PID above to stop the process and free up your port again:
kill 45624