8080 port already taken issue when trying to run your project

ยท

1 min read

Have you been encountering the same issue I have been encountering?

I was working on a svelte project, but anytime I run npm run dev afresh, it opens on port 8080, serving the wrong file for me.

The image below was what I was expecting to see on my screen. What I expected to see

But to my surprise I am been served this particular page in the image below.

What I am been served

It's like you shoping on Aliexpress and receiving what you didn't order for. I tried looking for the file that the node server is serving for me, but can't find it.

Thank God to this debug on my code... I clicked on it, and selected dev the debug shortcut in my vscode it worked like magic, serve me the correct file i need.

Sometimes the above solution might not help, so another thing you can do is to clear the cache of localhost:8080 Click on the circle icon in the image below: click on this circled icon

Then click on Site settings, check image below: site settings

Then click clear data clear data image

You can now run npm run dev on the default port.

I hope this will also help you, if you have same problem.