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

events.js:183 throw er; // unhandled 'error' event react
events.js:183 throw er; // unhandled 'error' event reactjs
events.js:183 throw er; // unhandled 'error' event node
throw er // unhandled 'error' event node js
throw er; // unhandled 'error' event angular
events js 174 throw er; // unhandled 'error' event react native
events.js:183 throw er; // unhandled 'error' event angular
events.js:174 throw er; // unhandled 'error' event nodejs

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 all programs, and run the app.js again, this error message pops out

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

Error: listen EADDRINUSE :::3978
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at Server.listen (net.js:1476:7)
    at Server.listen (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\node_modules\restify\lib\server.js:404:32)
    at Object.<anonymous> (C:\Users\yu\Documents\GitHub\BotBuilder-
Samples\Node\cards-AdaptiveCards\app.js:10:8)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)

I found some solution to this, It looks like the port 3978 was taken when I run the js file for the second time, and I have to use cmd to find which task is using that port, and then kill the task.

C:\>netstat -aon|findstr 3978

so this one is taking the port, although I already closed all programs

TCP    0.0.0.0:3978           0.0.0.0:0              LISTENING       13140
TCP    [::]:3978              [::]:0                 LISTENING       13140

actually it is node.exe itself, it still running at background

C:\Users\yu>tasklist|findstr 13140
node.exe                     13140 Console                    1     42,064 K

and I need to kill it

C:\Users\yu>taskkill /f /t /im node.exe

Is there a way to not always repeat doing this when I want to run the file more than one time, it just starts to go wired today, and I mean for all different app.js files, include offical sample code. For the past one month, everything was fine, the IDE I am using is sublime text 3, node.js version is 8.9.4 lts

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.

events.js:183 throw er; // Unhandled 'error' event · Issue #4458 , events.js:183 throw er; // Unhandled 'error' event #4458. Closed. anitahkimanthi opened this issue on May 14, 2018 · 8 comments. Closed  events.js:183 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at _errnoException (util.js:1024:11) at TCP.onread (net.js:615:25) #2922 Closed nigel-dewar opened this issue Dec 18, 2017 · 20 comments

I also got the same problem and tried many ways but finally got this ,this work well

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

refer to this link for more clarifications https://github.com/ionic-team/ionic-cli/issues/2922

events.js:183 throw er; // Unhandled 'error' event ^ Error: read , Brand new install of Ionic on Windows 10 Pro npm i ionic cordova -g versions Node v 8.9.1 NPM v 5.5.1 Ionic -v 3.19.0 cordova -v 7.1.0 created  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

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

How to Fix "throw er; // Unhandled 'error' event"?, npm run watch fails with this cryptic message. Some errors are easy and simple. events.js:182 throw er; // Unhandled 'error' event ^ the NPM cache ( npm cache clear --force ) before reinstalling the node dependencies. events.js:183 throw er; // Unhandled 'error' event I also got the same kind of problem and tried many ways but finally got this, this works well: npm install ws@3.3.2 --save-dev --save-exact

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.

node.js error message events.js:183 throw er - html, node.js error message events.js:183 throw er; // Unhandled 'error' event - node.js. dir is not a real executable in windows, so node.js cannot find the program you want to run. You didn't bind an 'error' handler to your child process and the event was turned into an exception that crashed your node instance. Do this: dir.on('error', function (err) { console.log('dir error', err); }); Use fs.readdir instead. It's a standard node.js API that does the same thing.

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

killall node

and restart your app.

"events.js:183 throw er; // Unhandled 'error' event", "events.js:183 throw er; // Unhandled 'error' event" meteor handle this exception and prompting an error message instead of crashing the entire app??? You can get this error if you're using the wrong version of node. events.js:183 throw er; // Unhandled 'error' event ^ Error: SQLITE_BUSY: database is locked RECEIVED ERROR IN GEKKO 9479992344356823 Child process has died.** Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)

Events.js:183 throw er; // Unhandled 'error' eventError: read , events.js:183 throw er; // Unhandled 'error' eventError: read Here is the piece of code where i am sending the sms link to the url… function  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Events.js183 throw er unhandled error event nodejs Jobs , Search for jobs related to Events.js183 throw er unhandled error event nodejs or hire My website is ready but doesnt load: "There has been a critical error on your website. building in nodejs reactjs react js css a gambling page 6 days left​. δηλαδή events.js: 183 ρίξτε er? // Μη χειρισμένο συμβάν «σφάλματος» ^ Στην περίπτωσή μου, έπαιρνα αυτό το σφάλμα επειδή είχα αλλάξει τον αριθμό θύρας Mysql 3306 σε 3307 κατά την εγκατάσταση.

Fixing – events.js:183 throw er; // Unhandled 'error' event, when npm , project folder, I got the error events.js:183 throw er; // Unhandled 'error' event update & node node_modules/phantomjs-prebuilt/install.js. it is more than access-grant issue than port-in-use issue. I faced the same problem and still don't don't find a clue how to solve it. For a quick solution run your webpack-dev-server with sudo I could manage to start dev server with sudo.

Comments
  • How exactly are you running app.js the first time? If you are using sublime to build and execute, you can also use it to kill node.exe process that is hosting app.js.
  • Running app.js the first time means I run it after the computer boots, and how to kill the node.exe by using sublime text?
  • nevermind, I just wrote a bat file to kill the node.exe, since it always take the port 3978, thanks for your help
  • "i run it after the computer boots" -- yes, but HOW do you run app.js? From the command line ("node.exe app.js"), from within Sublime using shortcuts? Using a .bat file to kill the node process seems odd, and should not be necessary.
  • ok, I see the reason now, I added a javascript build system to the sublime text(got from here pawelgrzybek.com/javascript-console-in-sublime-text), so I only need to press f7 to run the code, to lazy to type node app.js in node.js command prompt, seems like this issue only appear when I use sublime text to run it
  • the second option worked for me, thanks
  • I'm using Ubuntu 18.04 and your answer worked perfectly! Thank you
  • This is a duplicate of Janith Udara's answer.