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
Feedback sent
We appreciate your effort and will try to fix the article