-2

I have to get score of user in my quiz.Here, is the link https://replit.com/@ArpitKumar9/quiz-1#index.js

  • 1
    You are required to post a [mcve] here, **within your question**, and [not a link](https://meta.stackoverflow.com/a/254430/162698) to any other site. – Rob Jul 11 '21 at 08:33

1 Answers1

0

It seems to be an error with this package you use. Node.js has a built-in core module for readline: nodejs.org/docs/latest-v12.x/api/readline.html

You better use that instead.

An excerpt from node docs:

const readline = require('readline');

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

rl.question('What do you think of Node.js? ', (answer) => {
  // TODO: Log the answer in a database
  console.log(`Thank you for your valuable feedback: ${answer}`);

  rl.close();
});
Naor Levi
  • 1,713
  • 1
  • 13
  • 27