prompt() method works in terminal but not debug console vscode (javascript)

Viewed 29

so i have this code

"use strict";

const ps = require("prompt-sync");
const prompt = ps();

let base = prompt("base :");
let height = prompt("height:");
let area = (base * height / 2);
console.log(`The area of triangle is ${area}`);

When I run it in the terminal (node filename.js), the code works.

But when I run it in debug console, I got this error:

Uncaught Error Error: ENXIO: no such device or address, open '/dev/tty

Any idea why?

0 Answers
Related