无法找到/终止在 macOS 上无限循环的 (node) http-server 进程。

huangapple go评论75阅读模式
英文:

cannot find/kill (node) http-server process which is in infinite loop on macOS

问题

我使用以下命令运行了一个本地HTTP服务器:
./node_modules/.bin/http-server -a localhost dist

我认为代码中包含了一个无限循环,自那以后,我无法终止或找到该进程。

我在终端中退出了该进程,甚至重新启动了计算机(macOS 13.4)。

运行lsof -i :8080lsof -i -P | grep 8080没有显示任何内容。

但是,当我在Chrome中打开localhost:8080时,应用程序会打开并在一个无限循环中运行。

这个进程在哪里?

英文:

i was running a local http server using the command:
./node_modules/.bin/http-server -a localhost dist

i think the code contained an infinite loop and since then, i cannot kill nor find the process.

i exited the process in the terminal, even restarted the computer (macOS 13.4).

checking lsof -i :8080 or lsof -i -P | grep 8080 shows nothing.

but when i open localhost:8080 in Chrome, the app opens and is running in an infinite loop.

where is this process?

答案1

得分: 1

如果您重新启动了您的Mac,或者您已经终止了该进程,可以使用以下其中一个命令:

kill $(lsof -t -i:8080)

或者更加强硬的方式:

kill -9 $(lsof -t -i:8080)

您将不会看到它作为一个正在运行的进程。

为了排除您实际上看到的是Chrome的缓存的可能性,请尝试在私密模式或其他浏览器中输入:

localhost:8080

英文:

If you restarted your Mac, or you have killed the process, using one of the following commands

kill $(lsof -t -i:8080)

or more brutal

kill -9 $(lsof -t -i:8080)

you won't see it as a running process.

To eliminate the possibility that you in fact see Chrome's cache, please try

localhost:8080

in Private mode or some other browser instead.

huangapple
  • 本文由 发表于 2023年6月12日 01:17:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76451640.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定