node.js error message events.js:183 throw er; // Unhandled 'error' event

后端 未结 13 1063
囚心锁ツ
囚心锁ツ 2020-12-18 04:25

Playing around Microsoft\'s botframework, when I try to run the app.js file, which is the main file of the bot, the first time is fine, after I close the bot emulator, and a

相关标签:
13条回答
  • 2020-12-18 04:42

    This happens when you open another project without having closed the one you were already using, remember to always use Ctrl+c when you finish using a project. Try rebooting your PC and it should work again. At least that's what worked for me.

    0 讨论(0)
  • 2020-12-18 04:45

    Even I was also getting the error while running node server. i.e events.js:183 throw er; // Unhandled 'error' event ^ In my case, I was getting that error because I had changed Mysql port number 3306 to 3307 while installing. I recovered from from that error by changing Mysql port number to 3306, and now its running.

    0 讨论(0)
  • 2020-12-18 04:54

    If you are on mac, to make sure nothing is running on the same port, do:

    killall node
    

    and restart your app.

    0 讨论(0)
  • 2020-12-18 04:54

    You might be running some other application on the same port, and it is still running. So you can't run two applications on the same port.

    0 讨论(0)
  • This is a very common issue and can be easily fixed by either of the below methods.

    1. Try to close the process that is using your port.

      netstat -tulnp | grep <port_number>

    2. Installing the below pakcage fixed it for me forever.

      npm install ws@3.3.2 --save-dev --save-exact

    3. Run this command in your terminal :

      echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

      For Arch Linux add this line to /etc/sysctl.d/99-sysctl.conf:

      fs.inotify.max_user_watches=524288

      Then execute:

      sysctl --system

      This will also persist across reboots.

      https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details

    Either one of the solutions will work . If not then restart your system and check again.

    0 讨论(0)
  • 2020-12-18 04:56

    Try specify a different port before you run the node.js application.

    For example, if you have collision on port 3978, set a different port before you start the server.js:

    export PORT=3979

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