Search code examples
angularangular-cli

Angular cli - ng command open the ng file


I have an Angular project and if I want to start the project with 'ng serve' it is opening the ng file from

C:\Users{user}\AppData\Roaming\npm\node_modules\@angular\cli\bin

Also, I can start the project with 'npm start'.


Solution

  • You have configured wrong environment variable path.

    Path should be: C:\Users\{UserName}\AppData\Roaming\npm

    NOTE: Verify ng.cmd file should be there in C:\Users\{UserName}\AppData\Roaming\npm. If not please reinstall anglular cli.