Angular error in visual studio 2019 with Asp.netcore3.1

Marimuthu K 0 Reputation points
2023-07-07T05:22:25.2766667+00:00

I am using Visual studio 2019 with .netcore 3.1

I installed npm from Nodejs.org. it installed successfully. Created my first angular project in Visual studio. No changes done. Getting the following error.

AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests.

Developer technologies ASP.NET ASP.NET Core
Windows for business Windows Client for IT Pros User experience Other
Developer technologies Visual Studio Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2023-07-07T08:36:25.3466667+00:00

    Hi @Marimuthu, I tried to reproduce your issue first. I created angular in VS 2022 with .net 7 first and I found the project created by the template worked well.

    User's image

    In my windows machine, I installed nodejs with version like below.

    User's image

    Then I created angular project with asp.net core 3.1, I reproduced your issue like screenshot below.

    User's image

    I searched for this error and found it points to nodejs version (version compatibility). If you had the same issue with me, I think you might downgrade the nodejs version then it could work. In windows machine we have to uninstall the nodejs and install the old version of nodejs. I used v10.9.0.

    User's image

    ================================================

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,

    TinyWang

    0 comments No comments

  2. Limitless Technology 44,751 Reputation points
    2023-07-07T12:24:20.1766667+00:00

    Hello,

    The error message you're encountering indicates that there was an issue with the execution of the start script in your Angular project. This script is responsible for starting the Angular CLI development server, which listens for requests.

    To troubleshoot this issue, you can try the following steps:

    Make sure you have navigated to the correct directory where your Angular project is located. Open a command prompt or terminal and change the directory to your project's root folder.

    Ensure that you have all the necessary dependencies installed for your Angular project. In the project's root folder, run the command npm install to install the required packages specified in the package.json file.

    Once the dependencies are installed successfully, try running the start script again. Use the command npm start to execute the script. This will start the Angular development server.

    While the development server is running, open your web browser and navigate to the specified URL. By default, it should be *********************. If the server starts successfully, you should see your Angular application running.

    If the issue persists, there might be additional error messages or logs that could provide more information about the underlying problem. Review the output in the command prompt or terminal for any error messages or stack traces and investigate them further.

    Additionally, make sure you have the necessary Angular CLI installed globally on your machine. You can install it using the command npm install -g @angular/cli.

    If none of these steps resolve the issue, please provide any additional error messages or logs you receive, and I'll be happy to assist you further.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    --If the reply is helpful, please Upvote and Accept as answer--

    Alvaro Luis P

    12:55

    Hello,

    The error message you're encountering indicates that there was an issue with the execution of the start script in your Angular project. This script is responsible for starting the Angular CLI development server, which listens for requests.

    To troubleshoot this issue, you can try the following steps:

    Make sure you have navigated to the correct directory where your Angular project is located. Open a command prompt or terminal and change the directory to your project's root folder.

    Ensure that you have all the necessary dependencies installed for your Angular project. In the project's root folder, run the command npm install to install the required packages specified in the package.json file.

    Once the dependencies are installed successfully, try running the start script again. Use the command npm start to execute the script. This will start the Angular development server.

    While the development server is running, open your web browser and navigate to the specified URL. By default, it should be http:// localhost :4 200. If the server starts successfully, you should see your Angular application running.

    If the issue persists, there might be additional error messages or logs that could provide more information about the underlying problem. Review the output in the command prompt or terminal for any error messages or stack traces and investigate them further.

    Additionally, make sure you have the necessary Angular CLI installed globally on your machine. You can install it using the command npm install -g @angular/cli.

    If none of these steps resolve the issue, please provide any additional error messages or logs you receive, and I'll be happy to assist you further.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  3. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-07-07T15:51:38.3633333+00:00

    asp.net 3.1 and its angular template is out of support. there have been many changes to node, and the packages in the template are probably not compatible with the current version of node. try using node version 9. but the angular version is also way out of support. you should update to a current version of angular, which probably requires code changes in the template.

    your better is bet is to use the net 6/net 7 angular template.

    if you are stuck on 3.1 for some reason. then your best bet is to generate a new angular app.

    install the latest node
    cd to root folder
    install angular: npm install -g @angular/cli
    delete the ClientApp folder
    create a new app: ng new clientapp
    rename clientapp to ClientApp

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.