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
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.Verify Installation Check if Angular CLI is installed correctly:
ng version
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☺️