Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

296
Vistas
MongoDB/React Error: listen EADDRINUSE: address already in use :::5000

I am following this MERN tutorial: https://www.youtube.com/watch?v=ngc9gnGgUdA Around @18:00 is where I am having problems. After some research I think some of the code in the video is outdated and I am doing my best to get this to work! This is my current error: Error: listen EADDRINUSE: address already in use :::5000

import express from 'express';
import bodyParser from 'body-parser';
import mongoose from 'mongoose';
import cors from 'cors';

import postRoutes from './routes/posts.js';


const app = express();

app.use('/posts', postRoutes);
 

app.use(bodyParser.json( { limit: "30mb", extended: true}));
app.use(bodyParser.urlencoded( { limit: "30mb", extended: true}));

app.use(cors());

const CONNECTION_URL = 'mongodb+srv://test:test123@cluster0.mql8u.mongodb.net/myFirstDatabase?retryWrites=true&w=majority';
const PORT = process.env.PORT || 5000;


mongoose.createConnection(CONNECTION_URL).asPromise();

mongoose.connect(CONNECTION_URL)
.then(() => app.listen(PORT, () => console.log(`server running on port: ${PORT}` )))
.catch((error) => console.log(error.message));

I SUPER appreciate any and all help. If anyone can point me in the direction of a better tutorial that would be amazing! I am a novice code, I finished a virtual coding bootcamp recently, but I need to make some real apps. Thanks again!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First I would check and see if you already have something running on port 5000, to confirm, I would run npx kill-port 5000, then try to run port 5000 again to see if that port is now free after killing it via the previously noted command...

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda