error when starting dev server:Error: listen EACCES: permission denied 0.0.0.0:80 at Server.set

created at 06-19-2022 views: 16

error when starting dev server:

Error: listen EACCES: permission denied 0.0.0.0:80
at Server.setupListenHandle \[as _listen2\] ([node](https://so.csdn.net/so/search?q=node&spm=1001.2101.3001.7020):net:1313:21)
at listenInCluster (node:net:1378:12)
at Server.listen (node:net:1465:7)

With cnpm install you can

mac changed to 8090 Okay

mac terminal view port command.View the thread where the port is located

lsof -i:4700
$ lsof -i:4700
COMMAND PID USER FD TYPE TYPE DEVICE SIZE/OFF NODE NAME
node 12159 yyyyyy 23u IPv4 0x76b4f5051c4983f3 0t0 TCP *:netxms-agent (LISTEN)

The PID here is the process number that occupies port 4700

kill 4700

View mac terminal port command

netstat -AaLlnW

method 1

//Check if port 80 is occupied
sudo lsof -i :80

method 2

netstat -anp tcp | grep 80

The following command can directly end all processes occupying the port:

lsof -P | grep ':80' | awk '{print $2}' | xargs kill -9
Ps -ef|grep [program name]
created at:06-19-2022
edited at: 06-19-2022: