When PM2 starts the node service, it has been reported that the port is occupied, and it is useless to change the port several times.

vue+node

* *

< H2 > 1. Problem found < / H2 >

* *

* *

< H2 > 2. Find the problem < / H2 >

* *

 pm2 list 

clipboard.png


clipboard.png


clipboard.png

  
   pm2
   
  node
  nodekill -9 [pid] 
  
  

first of all, don't tag it indiscriminately. What does your question have to do with nginx?

I guess your problem is caused by pm2's fork mode, because fork mode does not support port reuse, which can cause this problem if you open multiple processes. Change fork to cluster try

in addition, the kill command cannot specify the port, but the process id (pid), such as kill 1234
to check the port occupancy, can use: ss-lntp | grep < port > , where < port > is the port you want to see

.

lsof-I: look at the port number

Menu