mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Make error message clearer if Node isn't installed (or not found on PATH). Fixes #527
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user