Reputation: 41
ng --version
Program 'ng' failed to run: No application is associated with the specified file for this operation At line:1 char:1
+ ng --version
+ ~~~~~~~~~~~~.
At line:1 char:1
+ ng --version
+ ~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
I tried to install angular by running 'npm install -g @angular/cli'
command. It installed properly but when I run ng command, it shows the above error.
Upvotes: 3
Views: 6424
Reputation: 1317
Sometimes this error comes if you are using powershell in VSCode terminal. I just changed it to cmd promt and it worked for me.
Upvotes: 1
Reputation: 744
I faced a similar issue and I added the following path to my system variable path : C:\Users\AppData\Roaming\npm
Then I found ng command is working in my system command prompt but not in Visual Studio Code. Hence I followed the below steps:
Upvotes: 4
Reputation: 197
Install node first - https://nodejs.org/en/ node -v TO CHECK NODE VERSION
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
ng -v TO CHECK CLI VERSION
Upvotes: 1