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

6
  • 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. Commented Sep 5, 2019 at 15:13
  • @ChrisW. npm install -g @angular/cli/ global . just following from the angular website Commented Sep 5, 2019 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 Commented Sep 5, 2019 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; pastebin.com/vectB3PA Commented Sep 5, 2019 at 15:19
  • I think it's messing up with my react libraries, though not completely sure why Commented Sep 5, 2019 at 15:20

2 Answers 2

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"
Sign up to request clarification or add additional context in comments.

4 Comments

I have tried to install with sudo on mac, though it still gives me the same problem : (
try to set up and alias like so 'alias ng="/Users/j.jones/.npm-global/bin/ng"'
obviously replace the path to match your installation
This has not resolved my issue. the .npm-global directory does not exist
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.