When starting the Node service under Linux, events.js:167 throw er appears; // The solution to this event has been Unhandled
pi@raspberrypi:~/ftp/files/node_nmusic $ node index.js
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EACCES 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1317:19)
at listenInCluster (net.js:1382:12)
at Server.listen (net.js:1469:7)
at Function.listen (/home/pi/ftp/files/node_nmusic/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/home/pi/ftp/files/node_nmusic/index.js:9:5)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1361:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:266:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
why
The Linux system cannot use ports below 1024 if the service is not started as root
The solution
Scenario 1: use 1024 or above port
scenario 2: use sudo as root