ExpressJS - throw er Unhandled error event

前端 未结 30 1908
囚心锁ツ
囚心锁ツ 2020-12-12 09:30

I created expressjs application using the following commands:

express -e folderName
npm install ejs --save
npm install

When I run the appli

相关标签:
30条回答
  • 2020-12-12 10:28

    None of the answers worked for me.

    When I restarted my computer I could get the server up and running.

    Mac
    shutdown now -r

    Linux
    sudo shutdown now -r

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

    I had the same problem and I found out, that a nodejs process that I had previously canceled with CTRL+C was still running. The problem in Windows 10 is, that Ctrl + C Doesn't Kill Gracefully nodejs. I opened the task manager and killed the process manually. The solutions provided on GitHub didn't work for me.

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

    IF it is in mac then it's all about IP of x86_64-apple-darwin13.4.0. If you follow errors it would be something related to x86_64-apple-darwin13.4.0. Add

    127.0.0.1 x86_64-apple-darwin13.4.0

    to /etc/hosts file. Then the problem is gone

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

    You had run another server use the same port like 8080.

    Maybe you had run node app in other shell, Please close it and run again.

    You can check PORT no. is available or not using

    netstat -tulnp | grep <port no>
    

    Alternatively, you can use lsof:

    lsof -i :<port no>
    
    0 讨论(0)
  • 2020-12-12 10:32

    An instance is probably still running. This will fix it.

    killall node
    

    Update: This command will only work on Linux/Ubuntu & Mac.

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

    The port you are listening to is already being listened by another process.

    When I faced to this error I killed the process using Windows PowerShell (because I used Windows)

    1. List itemopen the windows powershell
    2. type ps and then you can get list of processes
    3. find the process named node, and note the Id
    4. type Stop-process <Id> I think that it is help for windows users
    0 讨论(0)
提交回复
热议问题