Do I need to install Node.js on Production Server to host Angular 2?

后端 未结 1 1340
感动是毒
感动是毒 2021-01-18 23:35

I am trying to deploy my 1st Angular 2 app on our live server (Windows 2008R2 IIS 7.5 server)

The MVC part is running fine. I could see the login username and showi

1条回答
  •  离开以前
    2021-01-19 00:09

    If you have created your application using "AspNetCoreSpaTemplates" in VS2017 then by default it would add "Microsoft.AspNEtCore.SpaServices" to your project, you should see this under NuGet package list (please refer to the attached screenshot).

    Filetree

    This "Microsoft.AspNEtCore.SpaServices" package includes "Microsoft.AspNetCore.NodeServices" which has dependency for Node.js on the server.

    https://docs.microsoft.com/en-us/aspnet/core/client-side/spa-services

    Microsoft.AspNEtCore.SpaServices is used for server-side pre-rendering.

    If you do not need this, you can uninstall Microsoft.AspNEtCore.SpaServices from Nuget Package Manager option.

    After you uninstall it you should get 2 to 3 build errors as the SPA services is referred in "Startup.cs" & "ViewImports.cshtml". Comment or delete those reference and publish your code to server. Now it should work without Node.js on the server.

    0 讨论(0)
提交回复
热议问题