Every time you press F5 with VS code, you will generate a random port number and prompt that the port number is occupied.
I would like to ask what is the reason for this, and why he does not use the port defined by me but randomly generates it himself
The same is true when you change the inspector. app.js can break points but it takes 2 steps to pop up again.
Node.js should listen to a fixed port instead of randomly generating a port if it is used as an http server, otherwise your nginx/apache cannot proxy your port.
In addition, playing Node.js suggests to change to a linux/mac environment and run. You have a hole on windows where you can’t finish debugging Node. Apart from full-time windows client development, I can’t think of any development work suitable for windows.