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

357
Views
axios .then() no se ejecuta en node.js

así que estoy tratando de hacer una aplicación de terminal pero .then() no hace nada en absoluto. Traté de hacer una función que devuelve la respuesta y se ejecuta, pero devuelve indefinido. También estaba tratando de usar una libertad que me permitiera. obtener información de hardware, pero era asíncrono y no funcionó, ¿alguien puede ayudar? editar: olvidé agregar que el código funciona cuando intento ejecutarlo en otro script

código completo aquí: https://pastebin.com/Q4bNu0h0

 while (true) { a = prompt('esyx> '.red) if(a == 'exit'){ commands.exit.execute() }else if(a == 'help'){ commands.help.execute() }else if(a == 'cpu' || a == 'cpuModel'){ commands.getCpu.execute() }else if(a == 'mem' || a == 'totalMemory'){ commands.totalMemeory.execute() }else if(a == 'freemem' || a == 'freeMemory'){ commands.freeMemeory.execute() }else if(a.slice(0, 4) == 'ping'){ //problem here axios.get('https://www.shark-core.com').then(function (response) { console.log(response); }).catch(function (error) { console.log(error); }).then(function () { //this dosen't run console.log('testing') }); }else{ console.log(('"' + a + '" is not a real command').red) } }
about 4 years ago · Santiago Gelvez
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!