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

Related searches

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");
            }
        });

Error Screenshot:

Introduction to NPM Scripts, When this situation arises, one solution is to write bash or JS scripts (or scripts in any scripting language you like) and call them from NPM� To add a new separate script to auto-fix the linting issues for files with extensions .js and .jsx, you may add the add the script in your package.json as below: "lint:fix": "eslint --fix --ext .js,.jsx ." So after adding the above command the scripts section of your package.json may look like as below:

  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");
        }
      });

    }

Why npm Scripts?, Here are three problems I've seen multiple times: If a plugin doesn't exist for the command line tool you want to use, you're out of luck (unless you write� A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.

Note the pertinent part of the error **npm** is not recognized as an inernal or external command.

I was getting this error on a fresh Windows and VS install. Turns out that despite choosing the node.js development tools in the VS installer, node wasn't actually installed, so neither was npm.

You can test this by running node -v as the command prompt.

Solved for me by installing node. Note you may also have to do an npm install to download the dependencies in node_modules if you don't have them.

Using Npm Scripts as a Build Tool, npm scripts are a great way to automate common tasks during your Node.js scripts and don't want to have to deal with the argument parsing. You need to tell npm what to do when you run npm start explicitly by editing package.json. First, identify the main file of your application. Most often it is called index.js , server.js or app.js .

Argument parsing, environment variables and other hidden powers , Demystifying and having an understanding of the internals of npm scripts enables me to write better build tools and diagnose build problems� npm will default some script values based on package contents. "start": "node server.js" : If there is a server.js file in the root of your package, then npm will default the start command to node server.js .

How npm Scripts Work, Failed at the voting_app@1.1.0 start script 'npm run server'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the voting_app package, npm ERR! not with npm itself. npm ERR!

npm ERR! missing script: start For starters, make sure that you are in the "client" (cd client) or whichever name that you chose to build your creat-react-app 's client side. It seems as if you already have your start and react-scripts, so hope this helps.

Comments
  • Angular 1.x? Or angular 2 and above?
  • angular6........
  • can you try compiling in visual studio code and view output?
  • Have you managed to come up with a solution for this issue?
  • How do you "deploy in production mode"?
  • In my case I had web.config file that was getting updated with an ASPNETCORE_ENVIRONMENT variable during the publish process.