We often get error messages with the command ng serve –port:

ubuntu@ip-172-31-12-185:-/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: 132:11)at process._tickcallback (internal/process/next_tick.js: 180:9) How to check which process occupies port 3000?

The command netstat -tulpn shows that 3000 is occupied by process 15089.

Then use ps-aux to find the path of the process.

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: