Tag Archives: throw er; // Unhandled ‘error’ event

throw er; // Unhandled ‘error’ event

With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>

The following error is prompted when starting the service:

events.js:72
thrower;//Unhandled'error'event
^
Error:listenEADDRINUSE
aterrnoException(net.js:904:11)
atServer._listen2(net.js:1042:14)
atlisten(net.js:1064:10)
atServer.listen(net.js:1138:5)
atObject.start(/Users/Yao/MyWork/MyProject/node_js/lesson3/server.js:13:31)
atObject.<anonymous>(/Users/Yao/MyWork/MyProject/node_js/lesson3/index.js:10:8)
atModule._compile(module.js:456:26)
atObject.Module._extensions..js(module.js:474:10)
atModule.load(module.js:356:32)
atFunction.Module._load(module.js:312:12)

After investigation, it is found that another service that has been started uses the same port. The solution is to change the port number or stop the previous service

Throw Er of node error// Unhandled ‘error’ event solution

node Error:

Starting child process with 'node web.js'
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::8000
    at Object._errnoException (util.js:992:11)
    at _exceptionWithHostPort (util.js:1014:20)
    at Server.setupListenHandle [as _listen2] (net.js:1355:14)
    at listenInCluster (net.js:1396:12)
    at Server.listen (net.js:1480:7)
    at Object.<anonymous> (C:\Users\Administrator\Desktop\node\node\11\web.js:39:4)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
Program node web.js exited with code 1

Error reason:

The port number is occupied.

Solution:

Modify the port number, or take out the port number and restart the project

24178;- 25481;- 31471;- 21495;- p>

1.36827;- cmd20196;- 31383;- 20889;- netstat -ano-1244findstr “8080”

2.taskkill -PID 13512 -F