[Project problem] PM2 manager running error: Error: bind EADDRINUSE null:8360 (Alibaba cloud server)

My backend was created using the thinkjs project. After npm run compile compiled and uploaded to the server, I found an error: Error: bind EADDRINUSE null:8360

Step 1: Check the running log, the reason for the error is that port 8360 is occupied:

Step 2: Check the allowed port of the firewall. Although 8361 has been allowed, the status shows " unused ".

Step 3: Check the Alibaba Cloud server security group, and port 8361 has also been opened.

If you look at it this way, it is a problem with the configuration of the project itself .

Because the prompt port number is occupied, then we find a way to modify the port number on the official website.

By looking up the official documentation, we found that the default port number of thinkjs is 8360 , so we can solve the problem by modifying the port in src/config/config.js and $node_port in nginx.conf to 8361 .

If it still doesn't work, click " Restart "  in PM2 Manager .

The above is the solution for the port being occupied in the  PM2 manager .

I will share the common problems in my usual projects and the knowledge of the written test and interview with you on CSDN, and make progress together. Come on.

Guess you like

Origin blog.csdn.net/weixin_46318413/article/details/122356360