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

134
Vistas
Seemingly device-specific difficulties taking input using readline with Node.js

I'm trying to take input using readline but am running into an unknown error after doing so. To make matters worse, my friend has no difficulties running the exact same piece of code on his device.

const { Octokit } = require("@octokit/rest");
const readline = require("readline");
const util = require('util');

const octokit = new Octokit();
const rl = readline.createInterface(process.stdin, process.stdout);
const question = util.promisify(rl.question).bind(rl);

const getUsername = async () => { return await question("Enter GitHub username: "); }
const getRepoData = async (uname) => { return await octokit.request("/users/" + uname +  "/repos"); }


(async () => {
    try {
        console.log("checkpoint")
        const uname = await getUsername();
        console.log("checkpoint2")
        console.log(uname);
        var repoData = await getRepoData(uname); 
        repoData = repoData["data"]; // is a list of dictionaries, e.g. repoData[0]["name"]
        console.log(repoData);
    } catch (err) {
        console.log("FAILED");
        console.log(err);
    } finally {
        rl.close();
    }
})() 

My intention is that the program prints out information about a given GitHub user. However, running this program in console with node app.js results in

checkpoint
Enter GitHub username: fuzzyhappy
FAILED
fuzzyhappy

I have no idea why it's printing back the response to the question either.

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