如何解决发生未处理的异常:端口4200已在使用中使用'--port'指定其他端口
解决方法
您可以使用以下方法杀死端口:
kill $(lsof -ti:4200)
然后再次运行ng serve
。
尽管您有两个很可能没有连接的不同问题。您在浏览器中看到的错误是由于代码错误所致,我们需要更多信息来帮助您进行修复。
,这是在我的档案中。如何杀死Windows机器上的所有节点进程? taskkill /F /IM node.exe
这是另一种方法。
killall node
如果您使用Windows,则可以使用netstat -ano | findstr 4200获取pid 那么您可以使用taskkill / f / t / im yourpid关闭4200端口,然后重新启动它。希望它可以为您提供帮助
,您可以杀死4200上运行的任务,也可以只使用ng serve --port 4201
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。