MERN-3

Modified on Fri, 17 Feb, 2023 at 4:29 PM

My backend server is not running. I am getting Error: listen EADDRINUSE? (ID: MERN31)

This error typically occurs when you try to start a server or application that is already running and using the same port as the one you're trying to use. An instance of the server might already be running on the port 8082. You need to kill that process.

Run these to kill the process on port 8082 - 

npx kill-port 8082

After this press “y”, to grant permission

Sometimes you might have to run the command twice. 

Then you can just start the server again, using npm start



Getting User.find()/User.findOne()/User.findById() is not a function. (ID: MERN32)

Check the user.model.js file in models folder. You might not be exporting the model correctly.

Most probably your export would be like this

module.exports = userModel // (name of your model)

Change it to this

module.exports.User = userModel // (name of your model)

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article