1

After installing angular, I tried the ng -v command though it keeps showing me the command is not found.

node vsn 12.9.1 npm vsn 6.10.2

I have tried reinstalling, and tried uninstalling angular.

/na

-bash: ng: command not found

  • What command are you using to install? Are you using npm or yarn, are you installing global or as dev dependency, this is tough to diagnose without more information. – Chris W. Sep 05 '19 at 15:13
  • @ChrisW. npm install -g @angular/cli/ global . just following from the angular website –  Sep 05 '19 at 15:13
  • Do you get output specifying the installation was successful? You might try the actual whole package and not just cli via `npm install angular` – Chris W. Sep 05 '19 at 15:15
  • It says it is successful for the cli, though as trying for the package it also doesnt work as well. this is what is outputs; https://pastebin.com/vectB3PA –  Sep 05 '19 at 15:19
  • I think it's messing up with my react libraries, though not completely sure why –  Sep 05 '19 at 15:20
  • Possible duplicate of [Angular - ng: command not found](https://stackoverflow.com/questions/46623571/angular-ng-command-not-found) – Thomas Clague Sep 05 '19 at 15:29

2 Answers2

3

I had this issue a while back, I had installed and reinstalled multiple times. It turned out I wasn't running the CMD as administrator and it wouldn't let me use the angular CLI

*Solution was to set up and alias like so

alias ng="/Users/YourName/.npm-global/bin/ng"
Thomas Clague
  • 486
  • 1
  • 4
  • 16
0

None of this helped me, at the end I had to use nvm as described here

Angular CLI ng command not found on Mac Os

pixel
  • 9,653
  • 16
  • 82
  • 149