我们在用命令ng serve --port 时经常遇到错误消息:

[email protected]:-/KOI/Template/front-end$ ng serve --port 3000Port 3000 is already in use. Use ‘–port’ to specify a different port.Error: Port 3000 is already in use. Use ‘–port’ to specify a different port.at Server. server.once (/home/ubuntu/KOI/Template/front-end/node_modules/@angular-devkit/build-angular/srcngular-cli-files/utilities/check-port.js:27:28)
at object. onceWrapper (events.js:315:30)
at emitone (events.js:116:13)
at server. emit (events.js:211:7)
at emitErrorNT (net.js: 1387:8)
at _combinedTickCallback (internal/process/next_tick.js: 138:11)at process._tickcallback (internal/process/next_tick.js: 180:9)
如何查到哪一个进程占用了端口3000?

如何找到是哪一个进程占用了某个端口号

命令netstat -tulpn,发现是进程 15089占用了3000.

如何找到是哪一个进程占用了某个端口号

再使用ps -aux就能找到该进程的路径了。

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
如何找到是哪一个进程占用了某个端口号

相关文章:

  • 2022-12-23
  • 2021-06-26
  • 2021-12-15
  • 2022-01-01
  • 2022-12-23
  • 2021-10-13
  • 2021-07-08
  • 2022-12-23
猜你喜欢
  • 2021-06-04
  • 2021-11-18
  • 2022-01-10
  • 2021-08-20
  • 2022-12-23
  • 2022-01-22
  • 2021-12-15
相关资源
相似解决方案