I am currently creating a website on Codeanywhere that communicates with a back-end API/server. I ran my server.js node script with my ports on 8080 (front-end) and 8081 (server). However, I normally close the connection with Ctrl + C but I accidentally used Ctrl + Z to close the server down and since then I cannot run it again. Since I accidentally used Ctrl + Z and closed the tab on codeanywhere before doing anything else out of fear of damage my local host on codeanywhere when I run the script will not connect but instead take too long and time out. I am desperate for a solution as this is for a university module.
Pressing Ctrl+z does not stop your application, it sends it to the background. I wouldn't describe it as being in a running state but resources (such as the port) it was previously using remains bound to it.
Your application was timing out because you were trying to start another instance that shared the same resource (port) as the paused one.
To fix, type fg in your terminal and it should restore your application.
I know this question was asked a long time ago but who knows who this answer might help.
You need to kill the node
process. By doing Ctrl Z
you are just suspending it, without freeing it's locked resources (like the TCP port your are listening to).
If no other Node.js processes are running and killall
is available you could easily do killall node
and then restart the server. Else use any tool to kill the node
process.
© 2022 - 2024 — McMap. All rights reserved.