Javascriptservices: 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.

Created on 9 Sep 2017  ·  10Comments  ·  Source: aspnet/JavaScriptServices

I'm running a service fabric project; using aspcore 2.0. Locally it works fine of course.

I haven't been able to find any results online regarding how to include node and have it usable in your aspcore project and deployed to service fabric at the same time.

Can anyone offer some insight on how to get this working both locally and in a cluster?

Most helpful comment

Yes it's work for me, just copy 'node.exe' to the publish root of application.
I used Angular 2 + DotNet Core 2.0.
Thanks.

All 10 comments

I would also like some insight/direction on this.

Same here!

Q: How does one get Node.js installed on a Service Fabric VM scale set in all instances?

A: "You need to put a copy of node.exe in your application package."
thanks to Yi Zhang

@waynemunro Sorry I forgot to put that issue in place. When I create my aspcore app; and add node services, node.exe and all required files are in wwwroot, or any other folder I specify. It's not in the system path however so it can't be found.

If Node.js isn't installed on the nodes in your service fabric cluster, you'll need to add it manually. For example, please see instructions at https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-fabric/service-fabric-deploy-multiple-apps.md#packaging-the-nodejs-application

There's another example of this with an instructional video here: https://medium.com/@mattmazzola/running-node-express-application-as-guest-executable-in-service-fabric-f8a47c0c7422

Note that since NodeServices requires Node to be present on the environment PATH, you might also need to modify the PATH environment variable to add whatever directory you've added node.exe to.

I’ve just had the same issue trying to run an ASP.net Core Angular application in Service Fabric I resolved this by copying the node.exe into the application root and then setting the file property “Copy to Output directory” so that node.exe is copied to the bin folder.

Yes it's work for me, just copy 'node.exe' to the publish root of application.
I used Angular 2 + DotNet Core 2.0.
Thanks.

I've included node.exe along with other files both in wwwroot and alongside the root of the code itself; to no avail. It still can't find the node.exe process. Is there something extra that must be added to the project to find it?

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}

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}

How To Fixed Erorr

Was this page helpful?
0 / 5 - 0 ratings