0

That one is weird. I used Visual Studio Code to build a site with Gatsby.js. At some point I restarted my mac (Catalina) and with that, the VS Code as well.

But now, even after many reboots and without VS Code running at all, I have Gatsby's development server constantly running at http://localhost:9000. Can't find anything in Task Manager that resembles Node or Gatsby or Webpack.

How to quit that rogue web server?

Sven
  • 41
  • 6

1 Answers1

1

You need to kill all node listening ports. Just use: killall -9 node. It works for any node port, not just the 9000.

Another guess is to run ps aux | grep webpack to find the webpack running port and kill $(ps aux | grep 'webpack' | awk '{print $2}') to kill it.

Source: https://github.com/reactjs/react-router-tutorial/issues/240#issuecomment-317131545

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
  • Did that. Got "No matching processes belonging to you were found". But I can still reload my site running localhost… – Sven Jun 16 '20 at 11:53
  • Updated answer with another guess @Sven . – Ferran Buireu Jun 16 '20 at 12:19
  • Hmm, "ps aux | grep webpack" gives me something (sven 21160 0.0 0.0 4268300 696 s007 S+ 4:16PM 0:00.00 grep webpack). But "kill $(ps aux | grep 'webpack' | awk '{print $2}') " does not kill it. Instead, it tells me there is no such process (kill 21258 failed: no such process) – Sven Jun 16 '20 at 13:21
  • What about `killall -KILL node` ? – Ferran Buireu Jun 16 '20 at 13:22
  • "killall -KILL node" gets me "No matching processes belonging to you were found". Aha, maybe some other user has this server running? – Sven Jun 16 '20 at 13:26
  • And yet using "sudo killall -KILL node" gives me "No matching processes were found" Trying to kill process by ID gives me the same result… – Sven Jun 17 '20 at 14:53