Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node events.js:167 throw er; // Unhandled 'error' event

I'm trying to use JSON Server in a React App. However, I keep getting the following error.

events.js:167
  throw er; // Unhandled 'error' event
  ^
Emitted 'error' event at:
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1498:12)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:50:17)

I've upgraded npm and node to the latest versions. I've killed all processes with killall node and sudo killall -9 node

Any ideas what may be causing the issue?

like image 242
frente_fin Avatar asked Jun 10 '18 09:06

frente_fin


2 Answers

I had the same issue I ran killall node then npm start after that my local server at port 5000 worked again. Hope that helps you.

like image 193
Salma Elshahawy Avatar answered Oct 15 '22 09:10

Salma Elshahawy


Removing the node_modules directory and reinstalling again using npm install should solve the problem.

like image 41
Mahdi Irani Avatar answered Oct 15 '22 10:10

Mahdi Irani