英文:
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 :8080
或lsof -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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论