Node.js Using port 80 to report errors in Linux

node. js USES port 80 in Linux to report an error

Because the server USES CentOS8, the local environment is changed to Linux to facilitate development and deployment.

FATAL listen EACCES: Permission denied 0.0.0.0:80
the at Server setupListenHandle [as _listen2] (net. Js: 1296:21)
the at listenInCluster (net. Js: 1361:12)
the at doListen (net. Js: 1498:7)
the at processTicksAndRejections (internal/process/task_queues. Js: 85:21)
✖ Nuxt Fatal Error
Error: listen EACCES: permission denied 0.0.0.0:80
NPM ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxx dev: nuxt
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxx.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/xxx/.npm/_logs/xxx-debug.log

solution

initially suspected that port 80 was occupied, but when I checked the port information, I found that port 80 was not occupied, so I should have no permission to use port 80. The simple solution is to add sudo.

Replace NPM run devsudo NPM run dev


Read More: