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

325
Views
¿Cómo arreglar UnhandledPromiseRejectionWarning: TypeError?

Así que estoy creando una aplicación web usando Express.JS y MongoDB y cuando trato de ejecutarla localmente, funciona, pero cuando la ejecuto con mi máquina aws Ubuntu 20.04 me da el siguiente error:

 (node:13452) UnhandledPromiseRejectionWarning: TypeError: [objectOptions,urlOptions,exports.DEFAULT_OPTIONS].flatMap is not a function at parseOptions (/home/ubuntu/tylertv/node_modules/mongodb/lib/connection_string.js:258:77) at new MongoClient (/home/ubuntu/tylertv/node_modules/mongodb/lib/mongo_client.js:62:63) at Promise (/home/ubuntu/tylertv/node_modules/mongoose/lib/connection.js:784:16) at new Promise (<anonymous>) at NativeConnection.Connection.openUri (/home/ubuntu/tylertv/node_modules/mongoose/lib/connection.js:781:19) at _mongoose._promiseOrCallback.cb (/home/ubuntu/tylertv/node_modules/mongoose/lib/index.js:342:10) at Promise (/home/ubuntu/tylertv/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5) at new Promise (<anonymous>) at promiseOrCallback (/home/ubuntu/tylertv/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10) at Mongoose._promiseOrCallback (/home/ubuntu/tylertv/node_modules/mongoose/lib/index.js:1181:10) (node:13452) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:13452) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

No tengo idea de por qué esto está haciendo esto, todo lo que he instalado es mongodb, npm y node.

https://www.github.com/tttylerr/tylertv

^ Mi código fuente es server.js principalmente

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

0

Esto puede ocurrir por varias razones:

  1. ¿Tiene MongoDB instalado en su máquina AWS?
  2. ¿Las versiones de Node.js/NPM/MongoDB no coinciden en su máquina local y en la máquina de AWS?

PD: si ese error ocurre al inicio, entonces el error puede interpretarse como: "No se pudo conectar a la instancia de MongoDB". Revisa las cosas relacionadas con Mongo.

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!