listen EADDRINUSE: address already in use :::3000
date
Dec 20, 2022
slug
listen-EADDRINUSE-address-already-in-use-3000
status
Published
tags
Bugfix
Node.js
summary
type
Post
Background
I created a Web server in
Node.js with the codes below:Problem
I wanted to stop the server but I inadvertently pressed
Ctrl+Z instead of Ctrl+C.After that when I tried to start the server with
node starter.js, I got the error below:What’s wrong
This error tells us, the port number we are trying to run a server is already in use.
Ctrl+Z moves a running application to the background. To stop the server, we should use Ctrl+C.Solution
Use the following command to kill all the node processes currently running before you start the server: