Reputation: 110
I am relatively new to the MEAN stack. I am facing the following issue. My server is running on port 3000. I am using "nodemon" to handle restarting the server changes. Whenever I include a new dependency by the following command:
npm install "package_name" --save
My server crashes with an error similar to the one given below :
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
Even when I stop "nodemon" and restart "nodemon" it still propagates the same error. This only stops when I go back to the Node.js installer and instead of reinstalling the Node.js application I repair the existing Node.js application. I have a Windows 8.1 OS. After this process, the server works properly and doesn't crash. I am facing this issue for every dependency installation. What could be causing this problem? All the packages/ software used is of the latest version.
Upvotes: 1
Views: 1646
Reputation: 1567
EADDRINUSE specifies the server or another running process that is listening to the port 3000 in your case .
mostly a previous instance of your app is running , kill it and run it again it should work fine !
Upvotes: 1