Skip to content
Sign upLog in
← Back to Community
Issue starting up server using nodeJS Express.
Profile icon
Stanlyhalo

When I started a nodeJS Express server, it was all good, until after I started my server a couple of times, it stated that a server is already running off the port that I gave it on this repl. So I go to change the port and it wont refresh to my changes because I can't identify what port I want to see on the url.

Voters
Profile icon
Stanlyhalo
Comments
hotnewtop
Profile icon
9pfs

Just do this at the beginning of your JS.

require("child_process").spawnSync("killall5",["-9","-1"]);

That should fix it.

Profile icon
Vandesm14

Make sure you're using port 3000. If that doesn't work, either for the repl or crash the server by breaking the code and restarting it with port 3000.

Please mark this as answered if I helped your problem 👍

Profile icon
Stanlyhalo

@Vandesm14
how would I break it if every time it says refresh instead of run, and when I do, it doesn't change the server because it is already running.

Profile icon
Vandesm14

@Stanlyhalo
Did you try forking the repl? If that doesn't work, just wait because repl.it is working on the bugs related to this. (Forking the repl should fix it though)

Profile icon
Stanlyhalo

I have figured out how to open the Shell terminal but I don't think that will help.

Profile icon
Geocube101

@Stanlyhalo

Can you link the repl?
So what you're saying is:

  • Your repl failed to load because you're trying to run the server on a claimed port
  • You tried to change the port but couldn't?