When starting the Node service under Linux, events.js:167 throw er appears; // The solution to this event has been Unhandled
[email protected]:~/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
Read More:
- Error: listen EADDRINUSE :::3000
- Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘
- Error: listen eadrinuse::: 8000 solution
- Error: Cannot find module ‘process-nextick-args’
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Error reported after moving or copying Vue items: cannot find module ‘xxx‘
- Module build failed: Error: ENOENT: no such file or directory, scandir,‘node_modules\node-sass\vend’
- npm run devstart error: Error: Unable to find module ‘semver’
- Gulp error report, assertionerror [err_ ASSERTION]: Task function must be specified
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Module build failed: error: cannot find module ‘node sass’ error
- NPM- Cannot find module ‘xxxxx’
- Some mistakes in using NPM
- Front end project construction error unexpected character ‘@’ solution
- Webpack multi version incompatibility error
- Miscellaneous Notes (2)
- mac Error: EACCES: permission denied, mkdir ‘./cache’
- Error: Module did not self-register
- Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.
- When NPM install, make: G + +: command not found will be prompted