Reputation: 15018
I wrote the following code using 'readline-sync' dependency.
var readlineSync = require('readline-sync');
function main() {
printMenu();
var userName = readlineSync.question('Please enter your choice:');
console.log(userName);
}
main();
I ran this code from WebStorm trying to use the WebStorm console window. I got the error:
Error: The current environment doesn't support interactive reading from TTY. stty: when specifying an output style, modes may not be set
When I run it from linux terminal the code works with no error. I understand from the error message that 'readline-sync' cannot work from WebStorm console. Do you have any idea how to solve it?
Upvotes: 2
Views: 1328
Reputation: 15018
I found out the answer.
type in WebStorm terminal: $ node --debug-brk Web storm will give you the port number the debugger is listening to. On my machine it was 5858. Then press 'Ctrl+C'.
In WebStorm terminal type again: "$ node --debug-brk main.js "
Happy Debugging!
Upvotes: 2