Why does the Node.js scripting console instantly close in Windows 8?

I have tried almost every example for scripts that I can find. Each sample opens the terminal within a second. Even this closes as soon as input is entered. This is normal?

var rl = require('readline'); var prompts = rl.createInterface(process.stdin, process.stdout); prompts.question("How many servings of fruits and vegetables do you eat each day? ", function (servings) { var message = ''; if (servings < 5) { message = "Since you're only eating " + servings + " right now, you might want to start eating " + (5 - servings) + " more."; } else { message = "Excellent, your diet is on the right track!"; } console.log(message); process.exit(); }); 
+4
source share
1 answer

There are two options that control this in Tools / Options / Node.js Tools / General:

Wait for input if the process exists abnormally Wait for input if the process exists normally

Taken from https://nodejstools.codeplex.com/discussions/565665

0
source

Source: https://habr.com/ru/post/1492156/


All Articles