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

356
Views
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
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!