Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
Problema al ejecutar Nodemon: "[nodemon] salida limpia - esperando cambios antes de reiniciar"

Estoy configurando un servidor y cada vez que intento ejecutar npm start el siguiente error:

 [nodemon] 2.0.12 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` [nodemon] clean exit - waiting for changes before restart

He investigado en línea como StackOverflow, YouTube e incluso Reddit. Sin embargo, no entiendo por qué recibo este error, ya que agregué app.listen() . También npm update para asegurarme de tener la versión de npm más actualizada.

Además, parece que necesito volver a una versión anterior de Nodemon, pero me pregunto si hay una mejor manera de hacerlo con versiones más recientes.

Así es como se ve mi código :

índice.js:

 import express from "express"; import bodyParser from "body-parser"; import mongoose from "mongoose"; import cors from "cors"; const app = express(); app.use(express.json({ limit: "30mb", extended: true })); app.use(express.urlencoded({ limit: "30mb", extended: true })); app.use(cors()); // database connection string: PLEASE NOTE THAT I HAVE REPLACED MY PASSWORD WITH THE PROPER ONE HERE const CONNECTION_URL = "mongodb+srv://admin2021:<password>@cluster0.haf0y.mongodb.net/myFirstDatabase?retryWrites=true&w=majority"; const PORT = process.env.PORT || 5000; // connect to database mongoose .connect(CONNECTION_URL, { useNewUrlParser: true, useUnifiedTopology: true, }) .then(() => app.listen(PORT, () => console.log(`Server running on port: ${PORT}`)) ) .catch(() => (error) => console.log(error.message));

paquete.json:

 { "name": "server", "version": "1.0.0", "description": "", "main": "index.js", "type": "module", "scripts": { "start": "nodemon ./index.js" }, // etc. }

Tenga en cuenta que intenté reemplazar nodemon ./index.js con nodemon index.js pero obtengo el mismo error.

Cualquier ayuda es apreciada.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

// connect to database try { await mongoose.connect(url, options); } catch (error) { console.log('connnection error', error) } app.listen(PORT, () => console.log(`Server running on port: ${PORT}`))

Prueba esto

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!