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
^
Emitt
Little late, but for any out there struggling, I came across this error by creating the React app without using sudo
. Using sudo
while running npx create-react-app app-name
fixed the issue.
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.
I was facing the same problem. I ran the following commands:
Then it worked at port 3000. Hope that helps you.
Make sure you've closed the previous node connection before opening a new one on the same port.
Just try to close the earlier connection first, and then open the new one!
For windows users, run command
Taskkill /IM node.exe /F
It works for me.
Reference:
https://stackoverflow.com/a/51408717/9033834
I ran npm install and then npm update and it works again.