Error creating Angular stand alone project in Visual Studio 2022

Chris Reed (Queryon) 26 Reputation points
2022-05-20T18:15:53.097+00:00

Following this Microsoft document tutorial-asp-net-core-with-angular I am trying to create a solution with an Angular front end and c# api back end. When I click "Create" for the Angular project (using the stand alone template), I get the following error:
204130-eediz-2.jpg
I've tried uninstalling angular, force cleaning cache, and reinstalling both angular and node js (not sure that matters though). The uninstall removes the npm folder so there aren't any files left over.

I also updated VS to the latest version.

I found I can create a solution from the "ASP.NET Core with Angular" template. internet searches have given me nadda on this error. I'd appreciate any help.

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} vote

5 answers

Sort by: Most helpful
  1. MikeInSwitzerland 10 Reputation points
    2024-04-07T08:25:09.8133333+00:00

    This issue has been repeatedly reported by users over the years, and the Microsoft team has closed it each time, saying they don't have enough information.

    The big problem here is that VS2022 does not check that you have the version of Node / Angular CLI installed which it is expecting.

    And when this issue happens, it just vomits a vague error about "Version of Angular CLI was not valid" without any details about which version it was expecting (and which version you actually have installed). It also doesn't give any clues about if it needs/demands a particular value of Node.

    Given that VS2022 gives a template for letting users generate an Angular app from scratch, this is really poorly implemented. It's safest just to create the Angular app separately in VS Code and just use VS2022 for writing the WebApi service.

    (It's currently April 2024, and I'm running the latest version of VS 2022 Professional v17.9.5, and have Node 18 and 20 installed, and Angular 14.)

    2 people found this answer helpful.
    0 comments No comments

  2. KaLun Leung 10 Reputation points
    2025-11-26T01:22:31.0266667+00:00

    Latest update on Visual Studio 2026 Insider.

    The same issue occurs again when I create an Angular project. Eventually I need to use Angular v19 instead of the latest version (20 or 21). I think the compatibility issue on Angular 20 and Visual Studio is not yet solved.

    There is a compatibility issue with Angular 20.x.x and the Angular and ASP.NET Core template in Visual Studio 2022. To use Angular 20.x.x in Visual Studio 2022, it's recommended that you create an ASP.NET Core project first, add an Angular project to the solution, and then add a project reference to the Angular project from the ASP.NET Core project. You can use this method instead of using the combined template described in this article. For more information about the issue, see Creating a new Solution with Angular.
    Ref: https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?view=vs-2022

    The same note should be placed on VS 2026?

    2 people found this answer helpful.
    0 comments No comments

  3. Anna Xiu-MSFT 31,156 Reputation points Microsoft External Staff
    2022-05-23T08:32:22.37+00:00

    Hi @Chris Reed (Queryon) ,

    Welcome to Microsoft Q&A!

    You can run the “ng v” on an admin command prompt and check your Angular CLI and Node.js version.

    Please update your Angular CLI and Node.js to the latest stable version.
    Angular CLI v13.3.6: https://angular.io/cli
    Node v16.15.0: https://nodejs.org/en/download/

    Then, re-launch your VS2022 and try to create the project again.

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


  4. Noha Rashid Elawwad 6 Reputation points
    2022-06-03T20:33:26.42+00:00

    How is your problem now? Have you tried to repair your VS through running Visual Studio Installer > More > Repair?


  5. Martin Hagermark 0 Reputation points
    2024-12-21T15:43:36.1433333+00:00

    I got the same issue.
    I tried to reinstall Node.js, but still the same issue.

    Then I tried to install the latest version of angular cli globally...

    npm install -g @angular/cli@latest

    Then latest npm

    npm install -g npm@11.0.0

    And after that I was able to install the spa template.

    0 comments No comments

Your answer

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