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

前端 未结 19 2007

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         


        
相关标签:
19条回答
  • 2020-12-23 20:37

    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.

    0 讨论(0)
  • 2020-12-23 20:39

    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.

    0 讨论(0)
  • 2020-12-23 20:39

    I was facing the same problem. I ran the following commands:

    1. npm install
    2. npm start

    Then it worked at port 3000. Hope that helps you.

    0 讨论(0)
  • 2020-12-23 20:40

    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!

    0 讨论(0)
  • 2020-12-23 20:42

    For windows users, run command

    Taskkill /IM node.exe /F
    

    It works for me.

    Reference:

    https://stackoverflow.com/a/51408717/9033834

    0 讨论(0)
  • 2020-12-23 20:42

    I ran npm install and then npm update and it works again.

    0 讨论(0)
提交回复
热议问题