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

前端 未结 8 646

I\'m trying to run node 4.2.2 on a Mac OS and i\'m not understanding why every time i get this error message:

events.js:141
      throw er; // Unhandled \'er         


        
相关标签:
8条回答
  • 2020-12-24 12:08

    so it throw an error ,Unhandled 'error' event,which means you need handle the error event,add function on this event and print the error,you will find the reason and your program will act normal.

    0 讨论(0)
  • 2020-12-24 12:10

    Check whether any other Terminal is running other Applications on the same port. This happens when multiple applications trying to access the same port, Its always FIFO.

    Good Luck!!!

    0 讨论(0)
  • 2020-12-24 12:12

    this would not pertain to your error, but that error code can also run if a person is running node on multiple servers with the same address at the same time from their terminal.

    0 讨论(0)
  • 2020-12-24 12:14

    First Look for the other applications is running on the same port may be another node application.

    To find the current process running on the same port use:

    MAC:

    You can try netstat

    netstat -anp tcp | grep 3000
    

    For OSX "El Capitan" or if your netstat doesn't support -p, use lsof

    lsof -i tcp:3000 
    

    Then kill the process

    kill pid
    

    You can try to kill all node process use:

    killall -9 node
    
    0 讨论(0)
  • 2020-12-24 12:26

    ENOENT means that spawn was unable to find the binary you are looking for. Make sure that what ever you are trying to spawn is in your path.

    In this case you probably don't have gifsicle installed.

    0 讨论(0)
  • 2020-12-24 12:29

    Fixed the problem. There was a problem with the permissions for assets - if gulp can't take all assets. Then always there will displayed an error. I deleted the assets manually. I think i must be careful with(out) the "sudo" - command...

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