0

enter image description here

npm -g list command I can see installed Angular globally but when I run the ng --version it is giving   
this error ng: The term 'ng' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ng --version
+ ~~
    + CategoryInfo          : ObjectNotFound: (ng:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have deleted node and npm from my pc and reinstalled them, but it is still not working.

rturrado
  • 7,699
  • 6
  • 42
  • 62

2 Answers2

0

I think you need to check the version of the npm package instead. What you typed means you are asking it to check the version by running angular installed as a program on the computer, not an npm package. The command you want is npm list ng --depth=0. This gives you the version installed with npm. It takes it out of the list command you were using.

https://nodejs.dev/learn/find-the-installed-version-of-an-npm-package

If you want to be able to use angular from the command line, you need to install angular-cli as well.

krasi
  • 38
  • 10
  • Thank you for helping me, I have run npm list ng --depth=0 command it was showing me this " User@ C:\Users\User `-- (empty) " – techie_doston Jan 15 '22 at 10:16
0

First: Install CLI by writing->>>: npm install -g @angular/cli Second:if you want check your version writing -->>>: *ng v OR ng version*

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 10 '23 at 12:45