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)
linux系统如果是非root身份启动的服务无法使用1024以下的端口
方案1:使用1024以上的端口
方案2:使用sudo以root身份执行