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

376
Vistas
"npm start" shows "Unhandled promise rejection" error

I am new to NodeJS and NPM.

When I run npm start within a NodeJS project, the following errors occurred:

Starting the development server...

(node:9417) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3

What does this error mean? How should debug this problem?

$ grep start package.json 
    "start": "react-scripts start",

$ npm -v
3.10.10
$ node -v
v6.10.1

$ npm ls react-scripts
reference-apps@2.3.1 /home/li/sample
└── react-scripts@0.5.1  
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I guess your code like below

new Promise(function(resolve, reject){
    reject(0)
}).then()

when you run the code above, you will get “Unhandled promise rejection”.

with Promise/A+ standard #point-21. A promise must provide a then method to access its current or eventual value or reason.

you'd better write code as below

promise.then(onFulfilled, onRejected)

the other way to avoid the issue, you can listen the unhandledRejection event with process

process.on('unhandledRejection', (reason, p) => {
  console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
  // application specific logging, throwing an error, or other logic here
});  
over 4 years ago · Santiago Trujillo 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