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

358
Vistas
axios .then() doesn't run in node.js

so I'm trying to make a terminal app but .then() dosen't do anything at all i tried to make a function that returns the response and it runs but it returns undefined i was also trying to use a libery that let me get hardware info but it was async and it didn't work can anyone help? edit: i forgot to add that the code works when i try running it in another script

full code here: 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
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