Skip to content
← Back to Community
Error: listen EADDRINUSE: address already in use :::3000
Profile icon
8Observer8

Hi,

I created a simple example using Node.js and Express. It works as expected: https://repl.it/@8Observer8/My-First-Express-Server-in-TypeScript#src/server/App.ts

But I created a new one and I added Babylon.js game engine. My example does not work: https://repl.it/@8Observer8/BabylonJS-TypeScript#src/server/App.ts I see the error: Error: listen EADDRINUSE: address already in use :::3000

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
Le-BotBot
Profile icon
8Observer8
Comments
hotnewtop
Profile icon
Coder100

Ah, just change the port, or hit ctrl+shift+s and inside put: kill 1 (it kills all process, thus ending your server and the port being used)

Profile icon
8Observer8

@Coder100
I tried a lot of ports. kill 1 does not help. Please, try to change the port by yourself here: https://repl.it/@8Observer8/BabylonJS-TypeScript#src/server/App.ts

private _port = process.env.PORT || 3000;
Profile icon
Coder100

alright, I'll see what I can do about it

@8Observer8

Profile icon
Coder100

wow, that's really weird! Try forking it, and report this to bugs

@8Observer8

Profile icon
AbreuY

@Coder100
Thanks. kill 1 works for me. I have tried changing the port number and npx kill-port 3000 but without success.

Profile icon
Alexmejia992

I had the same mistake, and it was because I was traying to start the server using "npm start" on the shell and running the server using the play button at the same time. I could solve this error running the server using only the play button. I hope this can help you.

Profile icon
8Observer8

@Alexmejia992
are you able to run my example or does it say that it is unpublished?

Profile icon
8Observer8

HTML Client for Express works: https://repl.it/@8Observer8/HTML-client-for-Express-in-TypeScript#src/server/App.ts I will try to add code for the client.

Profile icon
SixBeeps

Try changing the port number to something other than 3000, maybe 3001?

Profile icon
8Observer8

@SixBeeps
changing ports is the first what I made. I tried 3001. Please, try to change port by yourself here: https://repl.it/@8Observer8/BabylonJS-TypeScript#src/server/App.ts

private _port = process.env.PORT || 3000;