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

262
Views
El aviso de Javascript Inquirer (paquete npm) se cierra con el código de salida uno solo en un lugar del programa

Traté de hacer un juego simple de cli nodejs, con el investigador para solicitar la entrada del jugador: nombre y respuestas a las preguntas.

Escribí el siguiente código, que funciona como se esperaba:

 async function askName() { playerName = (await inquirer.prompt({ name: 'player_name', type: 'input', message: 'What is your name?', default() { return 'Player'; }, })).player_name; }

Pero este código no funciona y mi depurador no entrará en él:

 async function acceptAnswer() { await inquirer.prompt({ name: 'player_name', type: 'input', message: 'What is your answer', validate(text) { if (/^[\u05D0-\u05EA]{5}$/.test(text)) // check if the input is a five letter word in Hebrew return true; console.log(chalk.red("Please try again")); return false; }, }); }

(Reviso, y la tiza no es el problema).

Ejecuto JetBrains Webstorm en Windows 21H2 con nodejs 16.13.2 y npm 8.1.2 ¡Se agradece cualquier ayuda!

about 4 years ago · Juan Pablo Isaza
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!