how to solve The NPM script 'start' exited without indicating that the Angular CLI












1














i am facing this error please help me this when i publish my app in IIS with angularjs please help me how to solve this error iam using .net core 2.1 and angularjs . In visual studio working fine I am facing this error in IIS



  services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
});


app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});


enter image description here










share|improve this question






















  • Angular 1.x? Or angular 2 and above?
    – joey
    Oct 10 at 3:45










  • angular6........
    – JOhns
    Oct 10 at 6:30










  • can you try compiling in visual studio code and view output?
    – joey
    Oct 11 at 3:33
















1














i am facing this error please help me this when i publish my app in IIS with angularjs please help me how to solve this error iam using .net core 2.1 and angularjs . In visual studio working fine I am facing this error in IIS



  services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
});


app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});


enter image description here










share|improve this question






















  • Angular 1.x? Or angular 2 and above?
    – joey
    Oct 10 at 3:45










  • angular6........
    – JOhns
    Oct 10 at 6:30










  • can you try compiling in visual studio code and view output?
    – joey
    Oct 11 at 3:33














1












1








1







i am facing this error please help me this when i publish my app in IIS with angularjs please help me how to solve this error iam using .net core 2.1 and angularjs . In visual studio working fine I am facing this error in IIS



  services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
});


app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});


enter image description here










share|improve this question













i am facing this error please help me this when i publish my app in IIS with angularjs please help me how to solve this error iam using .net core 2.1 and angularjs . In visual studio working fine I am facing this error in IIS



  services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
});


app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});


enter image description here







angular asp.net-core .net-core angular6






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 9 at 15:13









JOhns

398




398












  • Angular 1.x? Or angular 2 and above?
    – joey
    Oct 10 at 3:45










  • angular6........
    – JOhns
    Oct 10 at 6:30










  • can you try compiling in visual studio code and view output?
    – joey
    Oct 11 at 3:33


















  • Angular 1.x? Or angular 2 and above?
    – joey
    Oct 10 at 3:45










  • angular6........
    – JOhns
    Oct 10 at 6:30










  • can you try compiling in visual studio code and view output?
    – joey
    Oct 11 at 3:33
















Angular 1.x? Or angular 2 and above?
– joey
Oct 10 at 3:45




Angular 1.x? Or angular 2 and above?
– joey
Oct 10 at 3:45












angular6........
– JOhns
Oct 10 at 6:30




angular6........
– JOhns
Oct 10 at 6:30












can you try compiling in visual studio code and view output?
– joey
Oct 11 at 3:33




can you try compiling in visual studio code and view output?
– joey
Oct 11 at 3:33












2 Answers
2






active

oldest

votes


















2















  • npm script 'start' means, .Net Core is trying to call ng serve to
    run the angular module in development env. So when your are hosting
    your application in Azure/local or any other server, make sure you
    have not deployed your application in Development environment.
    "ASPNETCORE_ENVIRONMENT": "Development" Change it to
    "ASPNETCORE_ENVIRONMENT": "Production". Refer here


  • After you have deployed in production mode and still facing any other
    errors. Try the following to find out the error. Comment out the
    following code block in Startup.cs




//if (env.IsDevelopment())
// {
// spa.UseAngularCliServer(npmScript: "start");
// }




and deploy the application back in Development mode. You will get the real error message.



The variable can be changed in the ServiceManifest.xml file. By default it is not set.






share|improve this answer































    1














      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {

    app.UseDeveloperExceptionPage();
    app.UseHttpsRedirection();
    app.UseStaticFiles();
    app.UseAuthentication();
    app.UseSpaStaticFiles();

    app.UseMvc(routes =>
    {
    routes.MapRoute(
    name: "default",
    template: "{controller}/{action=Index}/{id?}");

    routes.MapSpaFallbackRoute(
    name: "spa-fallback",
    defaults: new { controller = "Home", action = "Index" });
    });

    app.UseSpa(spa =>
    {
    // To learn more about options for serving an Angular SPA from ASP.NET Core,
    // see https://go.microsoft.com/fwlink/?linkid=864501

    spa.Options.SourcePath = "ClientApp";

    if (env.IsDevelopment())
    {
    spa.UseAngularCliServer(npmScript: "start");
    }
    });

    }


    Add index.cshtml






    share|improve this answer





















      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52724294%2fhow-to-solve-the-npm-script-start-exited-without-indicating-that-the-angular-c%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2















      • npm script 'start' means, .Net Core is trying to call ng serve to
        run the angular module in development env. So when your are hosting
        your application in Azure/local or any other server, make sure you
        have not deployed your application in Development environment.
        "ASPNETCORE_ENVIRONMENT": "Development" Change it to
        "ASPNETCORE_ENVIRONMENT": "Production". Refer here


      • After you have deployed in production mode and still facing any other
        errors. Try the following to find out the error. Comment out the
        following code block in Startup.cs




      //if (env.IsDevelopment())
      // {
      // spa.UseAngularCliServer(npmScript: "start");
      // }




      and deploy the application back in Development mode. You will get the real error message.



      The variable can be changed in the ServiceManifest.xml file. By default it is not set.






      share|improve this answer




























        2















        • npm script 'start' means, .Net Core is trying to call ng serve to
          run the angular module in development env. So when your are hosting
          your application in Azure/local or any other server, make sure you
          have not deployed your application in Development environment.
          "ASPNETCORE_ENVIRONMENT": "Development" Change it to
          "ASPNETCORE_ENVIRONMENT": "Production". Refer here


        • After you have deployed in production mode and still facing any other
          errors. Try the following to find out the error. Comment out the
          following code block in Startup.cs




        //if (env.IsDevelopment())
        // {
        // spa.UseAngularCliServer(npmScript: "start");
        // }




        and deploy the application back in Development mode. You will get the real error message.



        The variable can be changed in the ServiceManifest.xml file. By default it is not set.






        share|improve this answer


























          2












          2








          2







          • npm script 'start' means, .Net Core is trying to call ng serve to
            run the angular module in development env. So when your are hosting
            your application in Azure/local or any other server, make sure you
            have not deployed your application in Development environment.
            "ASPNETCORE_ENVIRONMENT": "Development" Change it to
            "ASPNETCORE_ENVIRONMENT": "Production". Refer here


          • After you have deployed in production mode and still facing any other
            errors. Try the following to find out the error. Comment out the
            following code block in Startup.cs




          //if (env.IsDevelopment())
          // {
          // spa.UseAngularCliServer(npmScript: "start");
          // }




          and deploy the application back in Development mode. You will get the real error message.



          The variable can be changed in the ServiceManifest.xml file. By default it is not set.






          share|improve this answer















          • npm script 'start' means, .Net Core is trying to call ng serve to
            run the angular module in development env. So when your are hosting
            your application in Azure/local or any other server, make sure you
            have not deployed your application in Development environment.
            "ASPNETCORE_ENVIRONMENT": "Development" Change it to
            "ASPNETCORE_ENVIRONMENT": "Production". Refer here


          • After you have deployed in production mode and still facing any other
            errors. Try the following to find out the error. Comment out the
            following code block in Startup.cs




          //if (env.IsDevelopment())
          // {
          // spa.UseAngularCliServer(npmScript: "start");
          // }




          and deploy the application back in Development mode. You will get the real error message.



          The variable can be changed in the ServiceManifest.xml file. By default it is not set.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 20 at 7:17









          Nick

          1991111




          1991111










          answered Oct 10 at 17:21









          Mathew Abraham

          214




          214

























              1














                public void Configure(IApplicationBuilder app, IHostingEnvironment env)
              {

              app.UseDeveloperExceptionPage();
              app.UseHttpsRedirection();
              app.UseStaticFiles();
              app.UseAuthentication();
              app.UseSpaStaticFiles();

              app.UseMvc(routes =>
              {
              routes.MapRoute(
              name: "default",
              template: "{controller}/{action=Index}/{id?}");

              routes.MapSpaFallbackRoute(
              name: "spa-fallback",
              defaults: new { controller = "Home", action = "Index" });
              });

              app.UseSpa(spa =>
              {
              // To learn more about options for serving an Angular SPA from ASP.NET Core,
              // see https://go.microsoft.com/fwlink/?linkid=864501

              spa.Options.SourcePath = "ClientApp";

              if (env.IsDevelopment())
              {
              spa.UseAngularCliServer(npmScript: "start");
              }
              });

              }


              Add index.cshtml






              share|improve this answer


























                1














                  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
                {

                app.UseDeveloperExceptionPage();
                app.UseHttpsRedirection();
                app.UseStaticFiles();
                app.UseAuthentication();
                app.UseSpaStaticFiles();

                app.UseMvc(routes =>
                {
                routes.MapRoute(
                name: "default",
                template: "{controller}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                name: "spa-fallback",
                defaults: new { controller = "Home", action = "Index" });
                });

                app.UseSpa(spa =>
                {
                // To learn more about options for serving an Angular SPA from ASP.NET Core,
                // see https://go.microsoft.com/fwlink/?linkid=864501

                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                spa.UseAngularCliServer(npmScript: "start");
                }
                });

                }


                Add index.cshtml






                share|improve this answer
























                  1












                  1








                  1






                    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
                  {

                  app.UseDeveloperExceptionPage();
                  app.UseHttpsRedirection();
                  app.UseStaticFiles();
                  app.UseAuthentication();
                  app.UseSpaStaticFiles();

                  app.UseMvc(routes =>
                  {
                  routes.MapRoute(
                  name: "default",
                  template: "{controller}/{action=Index}/{id?}");

                  routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
                  });

                  app.UseSpa(spa =>
                  {
                  // To learn more about options for serving an Angular SPA from ASP.NET Core,
                  // see https://go.microsoft.com/fwlink/?linkid=864501

                  spa.Options.SourcePath = "ClientApp";

                  if (env.IsDevelopment())
                  {
                  spa.UseAngularCliServer(npmScript: "start");
                  }
                  });

                  }


                  Add index.cshtml






                  share|improve this answer












                    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
                  {

                  app.UseDeveloperExceptionPage();
                  app.UseHttpsRedirection();
                  app.UseStaticFiles();
                  app.UseAuthentication();
                  app.UseSpaStaticFiles();

                  app.UseMvc(routes =>
                  {
                  routes.MapRoute(
                  name: "default",
                  template: "{controller}/{action=Index}/{id?}");

                  routes.MapSpaFallbackRoute(
                  name: "spa-fallback",
                  defaults: new { controller = "Home", action = "Index" });
                  });

                  app.UseSpa(spa =>
                  {
                  // To learn more about options for serving an Angular SPA from ASP.NET Core,
                  // see https://go.microsoft.com/fwlink/?linkid=864501

                  spa.Options.SourcePath = "ClientApp";

                  if (env.IsDevelopment())
                  {
                  spa.UseAngularCliServer(npmScript: "start");
                  }
                  });

                  }


                  Add index.cshtml







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 11 at 13:56









                  JOhns

                  398




                  398






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52724294%2fhow-to-solve-the-npm-script-start-exited-without-indicating-that-the-angular-c%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Costa Masnaga

                      Fotorealismo

                      Sidney Franklin