We occasionally see errors like the one below that prevent us from starting a new project. I’ve outlined ways to fix the problem here.
Start CMD in administrator mode.
Remove Angular cli.
npm uninstall -g @angular/cli
From the appdata folder, delete the npm package files.
By hitting Windows + R, the Run menu will appear. then enter “%appdata%” and hit “OK.”
From the Roaming folder you received in Explorer, open the npm
If there are any, remove the ng and ng.cmd files from the npm folder.
If @angular and the angular/cli folder are present, open the node modules
Installing the Angular cli again
npm install -g @angular/cli
Using the command, create a new Project.
The ng serve command is used to generate and run the application.