8080 port already taken issue when trying to run your project

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.

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

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
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:

Then click on Site settings, check image below:

Then click clear data

You can now run npm run dev on the default port.
I hope this will also help you, if you have same problem.






