JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Failed to start node process

Open joelnotified opened this issue 9 years ago • 3 comments

Sorry for the double post (left a question on stackoverflow)

I'm using Microsoft.AspNetCore.NodeServices 1.1.1 in my ASP.Net Core application. Everything has been working fine, but now I'm on a new computer and I get the following error:

System.InvalidOperationException:
Failed to start Node process. To resolve this:.

[1] Ensure that Node.js is installed and can be found in one of the PATH directories.
	Current PATH enviroment variable is: ....
	Make sure the Node executable is in one of those directories, or update your PATH.

[2] See the InnerException for further details of the cause.

I have removed the path variables from this question, but the directory where Node is installed is listed in there (C:\Program Files\nodejs\;).

node -v in a terminal gives me v6.11.0 so it is added to the path.

Nothing in the code has changed since it last worked, only my computer. Does anyone know what could be wrong?

joelnotified avatar Jun 19 '17 16:06 joelnotified

Ok, so it was due to a missing folder on my new computer. Just a bit misleading error :)

This is how it was configured in Startup.cs:

services.AddNodeServices(options =>
{
    options.ProjectPath = "Path\That\Doesnt\Exist";
});

I added the path and now everything works as it should.

joelnotified avatar Jun 20 '17 06:06 joelnotified

Maybe it's good idea to reopen that issue and add some assertion to NodeService that check if this path exists?

rosieks avatar Jun 20 '17 07:06 rosieks

I am getting below error, Please help me on this. I am using React template using docker support for windows container. Although I have added both npm and nodejs folder path to Environmental folder.

InnerException {System.InvalidOperationException: Failed to start Node process. To resolve this:.

[1] Ensure that Node.js is installed and can be found in one of the PATH directories. Current PATH enviroment variable is: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\dotnet; Make sure the Node executable is in one of those directories, or update your PATH.

[2] See the InnerException for further details of the cause. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) --- End of inner exception stack trace --- at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, CancellationToken applicationStoppingToken, ILogger nodeOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort) at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(NodeServicesOptions options, Int32 port) at Microsoft.AspNetCore.NodeServices.HostingModels.NodeServicesOptionsExtensions.<>c__DisplayClass0_0.b__0() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__101.MoveNext()} System.Exception {System.InvalidOperationException}

shubhrajitb avatar Aug 07 '18 11:08 shubhrajitb