Skip to main content

How to resolve the "ng: command not found" Error

Published 1 min readMarkdown
How to resolve the "ng: command not found" Error

When setting up a new laptop and running an Angular project, you might encounter the ng: command not found error. This happens because the Angular CLI is not installed on your machine. Here’s how to resolve it:

Steps to Fix the Error

  1. Install Angular CLI Open your terminal and run:

     npm install -g @angular/cli
    

    This installs the Angular CLI globally, making the ng command available anywhere on your system.

  2. Verify Installation Check if Angular CLI is installed correctly:

     ng version
    
  3. Serve Your Project Navigate to your project directory and run:

     ng serve
    

By following these steps, you can ensure the Angular CLI is properly set up, and you can run your project without issues.

Hope this helped☺️

About the author

  • I'm Benedicta, a technical writer and frontend developer. I'll guide you through complex or simple programming concepts

No comments yet. Be the first to comment.

More from this blog