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
Read More:
- events.js:160 throw er; // Unhandled ‘error’ event ^ Error: write after end at Serv
- Error reported in react events.js:160 throw er; // Unhandled’error’ event
- Error code: events.js:183 throw er; // Unhandled’error’ event—solution
- solve events.js:174 Throw er; / / error reported by unhandled ‘error’ event
- Node.js Using port 80 to report errors in Linux
- Install and uninstall under Linux system Node.js
- Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘
- Node connects to MySQL error “Er”_ NOT_ SUPPORTED_ AUTH_ Mode “solution
- Solution to Starting Fault of routing and remote access service (16389 (0x4005))
- node.js Cannot find module “XXX” solution
- After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:
- NPM can’t find D: //nodejs/node all of The solution of sudden_modules/NPM/bin/npm-cli.js
- [Solved] gitbook: node_modules\npm\node_modules\graceful-fs\polyfills.js:287
- Module build failed: Error: ENOENT: no such file or directory, scandir,‘node_modules\node-sass\vend’
- After installing MySQL again under Linux, the solution of ‘MySQL module failed to start’ appears
- cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062: Solution
- Node.JS “Cannot enqueue Handshake after invoking quit” Error (Fixed)
- Node.js Cannot find module ‘mysql’ ‘express’
- Module build failed (from ./node_modules/postcss-loader/src/index.js):
- ERROR in ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/css/spec