Tag Archives: react port is occupied

Error reported in react events.js:160 throw er; // Unhandled’error’ event

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::8081
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1258:14)
    at listen (net.js:1294:10)
    at Server.listen (net.js:1390:5)

This problem is caused by the occupied port of 99.99%, such as the 8081 port mentioned above, so if you encounter this problem, please don’t be nervous, just find the corresponding port and close the application! How to check which application is used according to the port, this network a search a lot, here is not repeated! If you have any difficulty, please leave a message.)
Actually it’s not just react, as long as you use NPM to package, ports being occupied will report this error.