Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Change error "The system cannot find the file specified" to "Cannot find Node executable" for clarity #527

Closed

Description

@tjaartvanderWalt

I have followed this tutorial on getting angular and ASP.NET Core running together. The initial build worked fine but after updating angular packages I am receiving the following error on startup of the application(I also had to reinstall nodejs in the process, not sure if this is related):

The error is on the following line of code:

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions {
    HotModuleReplacement = true
});

System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.LaunchNodeProcess(ProcessStartInfo startInfo) at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance..ctor(String entryPointScript, String projectPath, String[] watchFileExtensions, String commandLineArguments, ILogger nodeOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort) at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance..ctor(String projectPath, String[] watchFileExtensions, ILogger nodeInstanceOutputLogger, IDictionary2 environmentVars, Int32 invocationTimeoutMilliseconds, Boolean launchWithDebugging, Int32 debuggingPort, Int32 port) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.CreateNodeInstance(NodeServicesOptions options) at Microsoft.AspNetCore.NodeServices.NodeServicesFactory.<>c__DisplayClass0_0.b__0() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.CreateNewNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.GetOrCreateCurrentNodeInstance() at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__10`1.MoveNext()}

Is there any way of getting more information from this error?

I have also asked the question on Stackoverflow

Activity

  1. LovedByTheLord commented on Dec 20, 2016

    @LovedByTheLord

    It looks like it is unable to find node.exe. I saw the same error after installing Node for the first time. It was because installing Node modified the system Path and the new Path wasn't getting picked up by IIS. I had to reboot my server and it was then able to find the node exe.

  2. tjaartvanderWalt commented on Dec 21, 2016

    @tjaartvanderWalt
    Author

    Thanks after I restarted my PC all worked again.

    Minimal reproduction of the problem with instructions:

    1. Backup your node.exe file located in C:\Program Files\nodejs
    2. Delete your node.exe file located in C:\Program Files\nodejs
    3. Run your ASP.NET Core application
    4. Expect the following error in Startup.cs

    An exception of type 'System.AggregateException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code
    Additional information: One or more errors occurred.

    @SteveSandersonMS Can we please update the error to say something like:

    Node.exe could not be found. Please make sure you have node.js installed.

  3. SteveSandersonMS commented on Jan 2, 2017

    @SteveSandersonMS
    Member

    Yep, will change that error message. Thanks for reporting it!

  4. changed the title [-]ASP.NET Core The system cannot find the file specified[/-] [+]Change error "The system cannot find the file specified" to "Cannot find Node executable" for clarity[/+] on Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions