Make error message clearer if Node isn't installed (or not found on PATH). Fixes #527

This commit is contained in:
SteveSandersonMS
2017-01-03 10:59:26 +00:00
parent 70f59fc8ec
commit fbb8054c2e

View File

@@ -325,6 +325,7 @@ If you haven't yet installed node-inspector, you can do so as follows:
private static Process LaunchNodeProcess(ProcessStartInfo startInfo)
{
try {
var process = Process.Start(startInfo);
// On Mac at least, a killed child process is left open as a zombie until the parent
@@ -336,6 +337,14 @@ If you haven't yet installed node-inspector, you can do so as follows:
process.EnableRaisingEvents = true;
return process;
} catch (Exception ex) {
var message = "Failed to start Node process. To resolve this:.\n\n"
+ "[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n"
+ $" Current PATH enviroment variable is: { Environment.GetEnvironmentVariable("PATH") }\n"
+ " Make sure the Node executable is in one of those directories, or update your PATH.\n\n"
+ "[2] See the InnerException for further details of the cause.";
throw new InvalidOperationException(message, ex);
}
}
private static string UnencodeNewlines(string str)