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.

Don't force Node to be on the PATH #20

Closed

Description

@andersekdahl

From what I can read, the code currently assumes that Node is on the PATH. I think it's a good idea not to bundle a specific version of Node with this package, but it would be great if it was possible to specify where the Node executable is. Would make it easier to deploy multiple sites using this to the same server where the different sites use different Node versions.

Activity

  1. SteveSandersonMS commented on Dec 9, 2015

    @SteveSandersonMS
    Member

    Good idea. This config option could be added to the services.AddNodeServices(config) API, with the default being to continue assuming Node is on the system path.

    Pull requests are welcome :)

  2. added a commit that references this issue on Jul 13, 2016
    122f78f
  3. SteveSandersonMS commented on Jul 18, 2016

    @SteveSandersonMS
    Member

    For anyone wondering how to override the path where the node executable is found, you can do it like this:

    public class MyHttpNodeInstance : HttpNodeInstance
    {
        protected override ProcessStartInfo PrepareNodeProcessStartInfo(string entryPointFilename, string projectPath, string commandLineArguments)
        {
            var startInfo = base.PrepareNodeProcessStartInfo(entryPointFilename, projectPath, commandLineArguments);
    
            // Here you can modify 'startInfo' to specify where the Node executable should be found
    
            return startInfo;
        }
    }

    ... and then set MyHttpNodeInstance as the active Node instance type, as per the docs at https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.NodeServices#custom-hosting-models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions