Handle invalid commands

const readline = require("readline");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
});


rl.question('$ ', (command) => {
  console.log(`${command}: command not found`);
  rl.close();
});

What is wrong with my code? It’s not passing to the next stage

Hey @LivLah, the code looks correct, but it might not have been saved or committed.

Could you share a screenshot of the code as shown in your editor so we can double-check?

Oh I passed the test. I tried to commit through the Vs code terminal and it worked!

1 Like

Just FYI, these indicate that the file has been modified but not yet committed.

Oh I see! Thank you so much, I’ll bear this in mind

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.