techie_doston
techie_doston

Reputation: 1

'ng' is not recognized after remove and reinstall

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.

Upvotes: 0

Views: 2749

Answers (2)

Mahmoud EL sayed
Mahmoud EL sayed

Reputation: 1

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

Upvotes: 0

krasi
krasi

Reputation: 38

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.

Upvotes: 0

Related Questions