I have recently started Javascript course & I configured my Visual studio code to run js.
Below is the code which I wrote
const prompt = require('prompt-sync')();
var fname = prompt("First name please :");
var lname = prompt("last name please :");
console.log("Your name is ",fname,lname);
I configured my VS code by installing Code Runner and also executing command npm install prompt-sync , however my code is throwing below list of long errors.
However if I try to run same code via cmd, it runs fine
Below are my npm and nodejs version

Can anyone please let me know what am I doing wrong?
Note:- I am storing and saving all my js files in a folder on local disk D

